I have seen other implementations that flip the IntBuffer instead of doing this in the for-loop but they lead to the same result for me. Note: The image is being flipped vertically in my code because otherwise the cursor is displayed upside down in OpenGL. The resulting cursor is almost perfect, except for a horizontal blank line in the middle. IntBuffer buffer = BufferUtils.createIntBuffer(w * h) Ĭursor cursor = new Cursor(w, h, 2, h - 2, 1, buffer, null) Int y = h - 1 - i / w // this will also flip the image vertically I have implemented the following method that I call right after creating the game window: public void loadCursor(BufferedImage img) throws LWJGLException I have been trying to create a custom mouse cursor in my LWJGL2 application running under Linux and I am almost there.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |