OpenGL initialization

I am struggling very hard to start a very simple project with OpenGL 4.0
I have used different books, but some don't work for Visual Studio 2012, the one I have and others don't specify a piece of code so I know that it works for my compiler.
I tried GLEW as the easiest linking possible, or at least I think of.
In the book using GLEW it doesn't even explain how to start and it has written fprintf, but I am using C++ not C.
Can anyone provide any help, piece of code or any other idea?
I think I am stuck for days with this :(
any help?
closed account (o1vk4iN6)
Yah glew is a bit of a pain as it uses macros to define all the functions. What exactly are you having trouble with ? You might be better off using a library to create the window (that's usually how you start lol), Qt comes to mind though there are probably more specialized ones. I believe glut "was" popular, it is older and closed source, though I guess it's just a matter of preference.
looks like the book i was reading was tremendous
it started immediately with shaders (this is good) but it assumed
I already knew how to create the window
This is stupid though, but it mentioned Qt and other stuff
I am not going to learn about Qt only to create a window
Started reading another book which uses visual studio 2008 and unfortunately,
MSVC 2012 doesn't work with anything at all
There is no library which helps you with that
I know that OpenGL is already there, but no book mentioned smth like that
(Note: Still no good book out there, but am starting opengl super bible
very simple to read and understand, exactly what i wanted
the visual studio 2008 though seemed bad cuz i was thinking of VS 2012)
Its a real pain to think that i have a week searching how to create a single triangle :(
Last edited on
I would recommend xoaxdotnet's tutorials on youtube :

He covers the basics of OpenGL using the GLUT wrapper, although some of his methods are pretty deprecated.

After familiarizing yourself with GLUT, (much later) you can move onto dropping third party wrappers (with the possible exception of glew) and writing your own OpenGL base in win32.
I was struggling with the same thing, but I finally had success using freeglut and MinGW.

This is the batch command I used to compile the program:

g++ -o Run.exe %1 -lfreeglut -lopengl32

Then I'd simply do 'compile.bat filename.cpp', then open Run.exe.

I had to put OpenGL32.lib and libfreeglut.a into MinGW\lib, and the GL folder of freeglut into MinGW\include, and freeglut.dll into MinGW\bin.

That's all I can remember, because it was a long, difficult, jumpy process.

I used a sample program which displayed a triangle to get me started, and I've come a long way since then.
Looks like my comment on that video has been thumbs up a lot of times :)
I have seen that video, but unfortunately didn't see all the video because of the deprecated version


I will use MSVC 2008 and reply if I have any progress or not
Last edited on

MSVC makes a bunch of garbage and dependencies...

I'm not sure how others feel about it, but IMHO MSVC is not a good way to start a project. There seem to be too many little things that can go wrong. Almost immediately after I made a new blank file without MSVC, I had this success. I guess that's really my opinion though, you can probably figure it out even with MSVC. :)
ok looks like it was very difficult
I made it using MSVC 2012 and I am proud for that
Luckily i had some experience using and installing other libraries
Never seen such a difficult installation, but I guess it's called 3D :)
Tomorrow will start with OpenGL and will make a great adventure!
So happy!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Last edited on
Topic archived. No new replies allowed.