Is it possible to intercept a control's paint event and make it draw in the opengl context?
I dont know if this is possible, but this tends to writing your own gui.
It whould be simpler to use a complete openGl Gui library.
http://libufo.sourceforge.net/
If you're using Qt there's a fun demo showing (working) Qt widgets rendering 3D in an OpenGL context. How useful that is to you depends how how hooked you are on the native win32 controls specifically.
Related
Is there a way to get OpenGL context from native code? Lets say, I need to draw something from my obj-c code. Anything, some object, complex bezier curve etc. I know that I need enterprise account. So I'm asking just about the OpenGL context. How it will look like and how to do it?
Corona Enterprise has APIs that allow you to interact with the Corona "Environment" from the native code. But I don't think it is possible to add something inside the Corona OpenGL (i.e, possible may even be, but Corona doesn't make that easy for you).
Usually when you draw or add something from the native code, like an image, you add that image to overlay view that is above the Corona OpenGL view. (In fact, that is why when using Corona Pro, all native objects always appear above of your corona elements)
I'm looking at the Sony SmartEyeGlass and it seems like the only way to interact with the "augmented reality layer" (what's drawn on the glasses) is through the proprietary Sony APIs.
I'm wondering whether there is a way to let OpenGL ES manage this layer as a GLSurfaceView ?
Or is there an alternative way to do 3D rendering on the glasses?
At the moment, there isn't a special API to connect with OpenGL. The way how to achieve OpenGL rendering with SmartEyeglass is to render your content directly to a Bitmap and show it using SmartEyeglassControlUtils.showBitmap(Bitmap bitmap)
Here you will find a solution, how to render OpenGL to a Bitmap:
Run Android OpenGL in Background as Rendering Resource for App?
Please let us know in comment, for what kind of application you need this OpenGL feature.
Good luck.
It is just curiosity. In Windows, for instance, how Qt interprets the stylesheets? this seems to be trivial, but, how does Qt tells the operating system to change the appearance of the widgets? Which library of methods of the Windows API uses? Does WPF uses the same Windows API libraries?
Cheers,
Qt custom draws all widgets. Qt may, under the hood, call into to OS provided API's for rendering each widget but a QButton is not an HWND using the BUTTON window class on windows. Qt does seem to use the OS for rendering text on the widgets but only the glyphs, not the complex rendering available in QLabel for example.
I am working on a mac osx control that is OpenGL based. Currently I am using an NSOpenGLView and a CVDisplayLink to coordinate my rendering on a background thread. This works great, but I need to allow Cocoa controls to be displayed over this OpenGL based control.
I realize you can do this with putting your Cocoa controls in borderless windows, however, that doesn't seem like a very good workflow for my users.
Alternatively I can make the view layer-backed and I got that working, however I don't like rendering my OpenGL content on the main thread, sometimes it blocks the main thread when the frame-rate dips.
Are there any samples that show how to achieve the best of both worlds?
The background thread for rendering is completely irrelevant. You just need to enable layer-backing for the views and then the subviews/controls will be composited correctly on top of your OpenGL content. You can also use CAOpenGLLayer for more explicit layering with CALayers.
I would like to write a library that draws some opengl on a given window handle.
How can I initialize an opengl-context inside a given window?
Is it possible to do that platform independent using SDL or some other library?
Qt provides a very good, cross platform mechanism for opening an OpenGL context and drawing into it. For details, see QtOpenGL.
You could use Open Producer or the OpenSceneGraph to do it as well.