PDA

View Full Version : how to make opengl run in windows aplication form vs2010 ??



hayahs
12-25-2012, 03:19 PM
have an opengl project and want to run it in vc 2010 in a windows aplication form
any tutorial or help ???

fiodis
01-04-2013, 11:26 AM
Do you mean in an application running on the .NET framework, or the older Win API? If it's the former, you can't have OpenGL and CLR (common language runtime) code running at the same time, so you'll need a wrapper like SharpGL or OpenTK. I've used SharpGL before and it's pretty straightforward, except I had some trouble getting shaders to compile properly.

mhanh547
01-04-2013, 11:19 PM
up bác d?t h*ng nha

idaka82
01-06-2013, 02:09 PM
Let me try to guess, you were asking for native (i.e., not CLR) C/C++ for Windows. Half a year ago I was wondering about he same problem as you, however, you will not find easy and ready to use project for you, since there many different approaches for that. Here is what I would recommend:
1) Any conventional C/C++ project will suffice for OpenGL development, with some caveats.
2) If you novice with OpenGL and has no previous experience with Win32 development (its where you have to have callback function like windowsProc and process all messages) start with GLUT library. For this, just create C/C++ Console project and use GLUT for the rest. More details are here http://www.opengl.org/resources/libraries/glut/. One note, this approach will lead your application to have two windows, the console one and the one with OpenGL context. Not nice, but good enough to get started.
3) Then step by step try to understand how to get rid of all helping methods that GLUT gives you (window creation, OpenGL context creation, mouse and keyboard events, etc.)
4) Finally, you will be ready for Win32 app that creates its own window without GLUT help and manages the OpenGL context, here is a viable tutorial http://www.functionx.com/win32/Lesson01.htm.

While learning last year, I went through these steps.

Best,
Ildar