Hello Guest

Issues while setting custom cursor with AWT Canvas

  • 0 Replies
  • 51 Views
Issues while setting custom cursor with AWT Canvas
« on: March 14, 2021, 02:28:28 »
Hello,

I',m fairly new to LWJGL (3) and I right now I'm working with the inputs (Keyboard and Mouse) as well as it's cursor pointer image (Custom and Hidden), but so far I'm having some issues while using the canvas with custom cursors.

This is what I have:

An initiator code for Canvas java component:
Code: [Select]
void init() {
ds = JAWT_GetDrawingSurface(this, awt.GetDrawingSurface());
int lock = JAWT_DrawingSurface_Lock(ds, ds.Lock());
if((lock & JAWT_LOCK_ERROR) != 0) throw new IllegalStateException("ds->Lock() failed");

try {
dsi = JAWT_DrawingSurface_GetDrawingSurfaceInfo(ds, ds.GetDrawingSurfaceInfo());
if(dsi == null) throw new IllegalStateException("ds->GetDrawingSurfaceInfo() failed");

dsi_win = JAWTWin32DrawingSurfaceInfo.create(dsi.platformInfo());

context = createContextGLFW(dsi_win);
glfwMakeContextCurrent(context);
glfwSwapInterval(1);
} finally {
JAWT_DrawingSurface_Unlock(ds, ds.Unlock());
}

fb = new FrameBuffer(getWidth(), getHeight());
        initiated = true;
}

And when I set the cursor either by using the java Component.setCursor() or the GLFW.glfwSetCursor(), I'm having some cursor conflict while rendering the canvas, as if both canvas cursor and GLFW cursor were fighting over dominance.

is there any way to overcome this?

best regards,
Jakes
« Last Edit: March 17, 2021, 21:21:57 by Jakes »