简体   繁体   English

使用可可在OSX的GL全屏模式下更改光标?

[英]Change cursor in GL fullscreen on OSX using cocoa?

Can anyone provide a sample / link to a sample Cocoa app that changes the 'hardware' cursor in a fullscreen OpenGL Cocoa app? 任何人都可以提供示例/指向示例Cocoa应用的链接,该示例可更改全屏OpenGL Cocoa应用中的“硬件”光标吗? I have been able to create a full screen GL app and an app that changes the cursor by overriding NSView::resetCursorRects but I have not been able to get both to work simultaneously. 我已经能够创建一个全屏的GL应用程序,以及一个通过覆盖NSView :: resetCursorRects来更改光标的应用程序,但我无法同时使它们同时工作。 I've also refitted some of the Apple GL samples (CocoaGL, Custom Cocoa OpenGL, etc) by overriding NSView::resetCursorRects and I haven't been able to get the cursor to change in fullscreen in them either. 我还通过覆盖NSView :: resetCursorRects重新装配了一些Apple GL示例(CocoaGL,Custom Cocoa OpenGL等),但我也无法使光标在全屏模式下进行更改。 I have the book "OpenGL Programming on Mac OS X" which also avoids the problem. 我有一本书“在Mac OS X上进行OpenGL编程”,它也避免了该问题。

@Christopher: I hadn't tried [NSCursor set]. @Christopher:我没有尝试过[NSCursor set]。 Good call but I made a run at it and no luck. 打个好电话,但是我碰碰运气,没有运气。 It still returns to the system cursor. 它仍然返回系统光标。 I'd say that perhaps something is overriding it in my calls that switch to fullscreen but I've actually tried reseting the mouse cursor in my NSView's draw routine (which gets called repeatedly) and the cursor never switches from the system default. 我想说的是,在切换到全屏的调用中可能覆盖了某些内容,但实际上我尝试在NSView的绘制例程中重置鼠标光标(反复调用),并且光标永远不会从系统默认值切换。

尝试直接使用NSCursor时,NSView光标rect方法取决于诸如适当大小和可见的NSWindow之类的内容才能正常工作,而在全屏模式下则不一定如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM