PDA

View Full Version : Unresolved HDC in opengl linux platform



dhruv369
05-06-2015, 03:15 AM
//in linux

#include <GL/gl.h>
#include <GL/glu.h>
#include<windows.h>

class OpenGLGraphicsContext : public IGraphicsContext
{

public:
OpenGLGraphicsContext(const Size& size,HDC hdc);
virtual ~OpenGLGraphicsContext();

// path primitive

.....
...
}

here "HDC" is unresolved if i add windows.h than it shows error in _mingw.h what shoud i have to do?

hidefromkgb
05-06-2015, 03:33 AM
Such things tend to happen when you try to use Win32-specific code on Linux.
Look here (https://www.opengl.org/wiki/Programming_OpenGL_in_Linux:_GLX_and_Xlib).

dhruv369
05-09-2015, 01:55 AM
if u know how to write simple onengl code without X windows then please post here.
And any one know how to initialize opengl function??

hidefromkgb
05-09-2015, 03:04 AM
Define «without».
What GUI toolkit do you want to use? Is it GTK+ (http://andrewboktor.googlecode.com/svn/trunk/gaspaint/examples/gtkglext-example.c) or Qt (http://doc.qt.io/qt-4.8/qt-opengl-hellogl-example.html)?
Is there any graphic environment at all? If no, then use OpenGL ES over DRI (http://virtuousgeek.org/blog/index.php/jbarnes/2011/10/31/writing_stanalone_programs_with_egl_and_).