Using winapi and opengl functions(c++) in Qt application (wndproc) - winapi

guys! We have working Project win32 with winapi functions which draws cube. We create a WNDCLASS and opengl context there for drawing. Can we use same functions like WinMain and WinProc in Qt for windows message processing?
We tried to do it, using hwnd of the window, without creating WNDCLASS. But after that we have just window without drawing area and rendering.
We should use winapi functions for next unloading theese functions in dll and use them in python and delphi.
Here is cpp-file
http://rgho.st/7KwpPfxZG

QT is a cross platform framework and takes care of hiding away things like WinMain and WindowProcs and instead provides a platform neutral abstraction.
Fortunately OpenGL is directly supported by QT - and they even have a page showing how to integrate OpenGL with QT here:
QT GUI OpenGL Window

Related

How does stylesheets work in Qt?

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.

Get hWnd for XAML control in Windows 8 (Metro) app?

I need to pass a hwnd to a native dll that is going to write raw video to the frame. In WPF this works because you can get a hwnd reference from a control. Is this possible in a Metro app?
It is not possible to get HWND for a control, because Metro doesn't have HWNDs.
If you can get the video stream, try using a video brush and setting the source.
Otherwise, look into SharpDx library, which is a managed port of DirectX. I think you can draw 'stuff' to an element from it.
Hope this helps.

Glut and Interface Builder

I would like to create an application with multiple views in XCode 4 for Mac, one of them which should display OpenGL.
Using Interface Builder, can I use the standard OpenGL view and still use Glut to program and display in this view ?
Thanks !
No, GLUT is a minimalistic framework, not to be used in serious applications or be mixed with other frameworks. As long as your GLUT applications just uses the canonical display, reshape, keyboard, mouse callback handlers, just call these from your GLView Cocoa code in your implementation of the interface.

Render a Win32 widget in the OpenGL context

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.

What is the best way to create a nested opengl canvas

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.

Resources