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.
Related
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
First of I am on Mac OS Mavericks and I use XCode 5.
I'm making a chess application and I use SDL. I now want to have an additional window with some tables and buttons that will show data about the game and control the SDL Window.
Would it be practical and possible to make the control window with Cocoa, or would it be easier to make the control window with SDL as well? Having forms and buttons and tables seems impractical with SDL, but maybe I'm wrong. Performance is very important.
I have experience with the SDL library with C++. I don't think/know if it would even be compatible with iOS development. I would personally use Cocoa for the window and SDL for other stuff if possible.
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.
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.
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.