1. OpenGL Window (Version 2.0)
Introduction
Welcome, to what is now your first OpenGL tutorial. Today, we are going to learn how to create a Window using OpenGL, GLUT (The OpenGL Utility) and GLEW.
But first, let me give you a brief rundown of GLUT and OpenGL, this is after all, your first time working with them both, and you must have some idea at least about OpenGL if you want to learn it.
OpenGL
OpenGL, also known as the Open Graphics Library, is a library designed for cross platform 3D graphics. It is directly, the only competitor to Direct3D in the DirectX library. OpenGL is also hardware accelerated, just like Direct3D, and both of these libraries are the main focus for graphics card performance.
GLUT
So what about GLUT? GLUT (The OpenGL Utility), is a tool which allows the creation of windows and handling of input on multiple systems. Making OpenGL cross-platform and extremely simple to set up. Unfortunately, the original GLUT is no longer being developed, but don’t worry, there is a remake of GLUT called FreeGLUT, which even works with the original GLUT dll files and is exactly the same to use.
GLEW
And finally GLEW, GLEW is the OpenGL Extension Wrangler, and gives us easy to use calls to OpenGL extensions, without us having to declare the dll entry points, which while are documented and are on the internet, is still a pain, and a waste of time, when you have a library designed for this.
Installation
Now that you know a little bit about them both, why don’t we actually get to using them? That is after all, why you are here.
Downloads
First off you are going to need to download:
FreeGLUT – http://freeglut.sourceforge.net/
GLEW – http://glew.sourceforge.net/
Once you have them both, follow their installation instructions, which are fairly simple. In short, find the “lib” and “include” folders for your current Visual Studio installation (for VC, not for VC#), and put the required files in each folder. Then find your System32 or SysWOW64 folder, and put the required dll files in them.
Visual Studio Project Configuration
Then you are going to want to open Visual Studio (all these tutorials have been written in the latest Visual Studio 2010, and they will work in everything prior) and start a New Project. From the project selection list, find and click on “Win32 Console Application”. You should then be prompted with a setup wizard, click on “Next” and tick “Empty Project”, and press “Finish”.
You should now have an empty Win32 console application, which we need to link to some library files. Go to your project properties, and under: “Configuration Properties” -> “Linker”, click on “Input” and add two additional dependencies. Add “glew32.lib” and “freeglut.lib” on separate lines.
Visual Studio should now be configured for us to start learning OpenGL.
Coding
And finally, let’s get on to some coding.
First, start a new C++ file in your project, you can call it whatever you like, but I always like to call my first file “main.cpp”, because I’m just so original 🙂
Inside your cpp file, you will want to first of all, include the header files for GLUT/FreeGLUT and OpenGL. Which after you have entered them, will look something like:
#include // Include the GLEW header file #include // Include the GLUT header file
And then create your standard main method, something like:
int main (void) { }
If this compiles, then you have your header files setup correctly. Congratulations!
GLUT
Now it’s time to actually start using GLUT and get a window appearing. The first thing we will want to do is redefine our main method, this is because all of our GLUT calls will be done in this method, and these parameters are required by GLUT. Change the declaration of your main method to:
int main (int argc, char **argv) { }
The parameters argc and argv allow us to add command line arguments, and are required when we initialize GLUT.
So now we initialize GLUT, which is done like so:
glutInit(&argc, argv); // Initialize GLUT
After we have initialized GLUT, we need to tell it how we want to setup our window. Here we tell GLUT if we want one or two buffers, if we want an alpha channel, if we want depth and stencil buffers, etc. Let’s start off simple, and go with the most basic, GLUT_SINGLE which will give us a single buffered window.
glutInitDisplayMode (GLUT_SINGLE); // Set up a basic display buffer (only single buffered for now)
Next, we need to set the size and the position on the screen for our GLUT window:
glutInitWindowSize (500, 500); // Set the width and height of the window glutInitWindowPosition (100, 100); // Set the position of the window
And finally, we create our window and give it a title/caption:
glutCreateWindow (“Your first OpenGL Window“); // Set the title for the window
This is going good, we now have a window of the size and position we want, and this should compile and display if you would like to test it (I know I did!). Testing your code often is a great habit to get into. I have known a lot of people to write a lot of code, compile it, and then not know where to start debugging. Even if all you are doing is checking for compilation errors, it’s good to fix these up early.
Once you run this, you will have a window appear with a console window behind it, and it will then disappear as your application would have run out of code and have exited.
So now we have a couple more methods to set up before GLUT opens a window, and then keeps it open.
The first of these things, is we want to tell GLUT what method will store our code for drawing, so that GLUT can then call on it when needed. As per a lot of OpenGL tutorials, I am going to use a method called “display”, as I have picked up the habit. You can call this anything you like, but it has to be declared like such:
void display (void) { }
Once we have a method we can use to do our drawing, we need to actually tell GLUT to use this method. To do so, we make a call to glutDisplayFunc() and pass in our display method, this is done inside of our main method after we create our window.
glutDisplayFunc(display);
Now that GLUT knows what method to use for drawing, all we have to do is tell GLUT to enter its Main loop. This is just a giant loop that continues forever, whilst calling the display, idle, keyboard, mouse and any other call back methods. So in code, it looks theoretically something like:
while (running) { display(); }
And while this loop is going, so is your application. So to start it, call:
glutMainLoop();
If you choose to run this, your window will stay open, but your window doesn’t have any OpenGL calls in it yet. So to show that OpenGL is working, lets fill in a basic display method.
To do this, we will first set the colour we want the window background to be. We do this with the call to glClearColor, which takes in 4 float parameters, each one referring to a colour, and in the other (red, green, blue, alpha).
So add this line to your display function, and we should get a nice red background:
glClearColor(1.f, 0.f, 0.f, 1.f); // Clear the background of our window to red
Now that we have the background colour set, let’s get into the habit of some cleaning up in OpenGL. Every time this display method is called in our loop, it adds on to what is currently stored in OpenGL’s giant state machine. So we need to clean this out, and reset it. We will reset the colour buffer, so that we get our red background every time, and we will load the identity matrix, so all our drawing starts at the same location as the previous time this method was called:
glClear (GL_COLOR_BUFFER_BIT); //Clear the colour buffer (more buffers later on) glLoadIdentity(); // Load the Identity Matrix to reset our drawing locations
And finally to top it all off, after we have drawn everything we want, we need a way to tell OpenGL to draw everything we have currently told it. In a single buffered window, we want to just do a straight flush from OpenGL to the window, and we can do this with:
glFlush(); // Flush the OpenGL buffers to the window
And that is it, if everything has worked along the way, you should now have a window that shows up with an OpenGL context, and displays a red background.
Well done!
If you have any questions, please email me at swiftless@gmail.com
#include <GL/glew.h> // Include the GLEW header file #include <GL/glut.h> // Include the GLUT header file void display (void) { glClearColor(1.0f, 0.0f, 0.0f, 1.0f); // Clear the background of our window to red glClear(GL_COLOR_BUFFER_BIT); //Clear the colour buffer (more buffers later on) glLoadIdentity(); // Load the Identity Matrix to reset our drawing locations glFlush(); // Flush the OpenGL buffers to the window } int main (int argc, char **argv) { glutInit(&argc, argv); // Initialize GLUT glutInitDisplayMode (GLUT_SINGLE); // Set up a basic display buffer (only single buffered for now) glutInitWindowSize (500, 500); // Set the width and height of the window glutInitWindowPosition (100, 100); // Set the position of the window glutCreateWindow ("Your first OpenGL Window"); // Set the title for the window glutDisplayFunc(display); // Tell GLUT to use the method "display" for rendering glutMainLoop(); // Enter GLUT's main loop }
in terminal, what is compiler command argument?
would be nice to add comment line with terminal compile info.
// g++ cube.cc -lm -lglut -lGL -lGLU -o cube
programmers that do this are so awesome,
it helps noobs like me so much.
compiler command is a huge problem for a noob if not given
it should be a standard taught as common courtesy
your tutorials seem wonderful, i can’t use them without //g++ info
g++ -lGL -lGLU -lglut -lGLEW -Wall -o “%e” “%f”
is what worked for me
Bad tutorials. OpenGL 2.0 support shaders man, so you should use shaders, don’t use deprecated functions of OpenGL 1.5!
Hi Dario90,
I know right, even though a lot of these functions weren’t actually deprecated until OpenGL 3.x and weren’t finally removed until OpenGL 4.x
They’re such bad tutorials, thanks for the comments 🙂
Thanks,
Swiftless
compile with gcc on Debian 7(works for me):
gcc main.c -o main -L/usr/include/X11 -IGL -IGLU -lglut
My window is coming up white instead of red. I copied the whole code and ran it and still no red window. i dont know what the problem is. =(
sorry, i ran the copied code and it works fine.
As per Haseeb’s comments above, I had this same issue, I kept on going through the tutorial and all worked out fine.
My belief is that it is not until the call to ‘glFlush();’ the red background takes effect on the window.
Thank you swiftless for this tutorial, I like the minimalist approach with explanations about each command used. I have attempted to read a number of books that try to use their own frameworks or have you jump straight into the programmable pipeline (most times using some provided code that is not explained). I was lost every time.
This tutorial reminds me of some excellent beginner C++ programming texts that start from hello world and explain each step.
Again, thank you and I hope the coming tutorials are just as good.
i installed visual studio 6 on windows 7…even icluded the opengl functions.When write a program,during compliation there is no error but while building it,its showing a link error as “LINK : fatal error LNK1104: cannot open file “Debug/fij.exe”
Error executing link.exe.”
plz help me out as early as possible..i want 2 use visual studio 6 only as it is instructed by our collage..
its very urgent..expecting a faster rly..
I came here after realizing your OpenGL 4 tutorial wasn’t intended for OpenGL newbies and just had to say awesome job! Very clean and easy to follow!
Why do i need glew? I spent 2 days trying to install this shit, to no avail. Also, where does the while(running) go? The intelli sense says its an error.
Hey,
while(running) is a description of what GLUT is doing in the background. GLEW is the OpenGL Extension Wrangler. It’s for when you start using more advanced features.
Thanks,
Swiftless
Good tuto.
Thank you for the red window.
i get a white window not a white one. I did the same as it was told in the lesson above any reason, why?
Very, very, nice tutorial.
Congratulations.
Very clear, I liked a lot how you explained the:
while (running) {
display();
}
part, thanks.
I’m using code:blocks, which, when I tried to compile, gave me this error message:
In function ‘int main(int, char**)’
error: ‘running’ was not declared in this scope|
||=== Build finished: 1 errors, 0 warnings ===|
According to the compiler, the variable “running” is out of scope. Look up the variable “running” in your source, and see if you can put it into “scope”.
Hi PER OLF,
“running” isn’t even used in the final program. If you read the description, that is a brief explanation of what GLUT is doing on the inside.
Cheers,
Swiftless
@Aditya : err !! nevermind .. done !!
hey, a very nice tutorial… but i can’t view my window created .. it just shows it on the panel but when i click it nothing happens. can you help me out ?? it looks as if it is transparent or something .. no windows boundary or whatever ..
That happened to me when i left out the last line:
glFlush();
One suggestion is that you make sure to copy every line of code from the tut exactly as thy are.
Hey thanks. great work. I was looking for good resource which will provide easy explanation of OpenGL Concepts with examples. Best of luck for your future work. Once again thanks for the good work.
You said we’re supposed to have a red background. My background is white. Why is that?
war are d arguments i need to pass to the code????
Thank you dearly for your tutorials. They are spot on and perfect for rendering to GLUT – which is where I want to be 🙂
Being new at 3d programming (well – I was big into VRML way back when ;), I really didn’t want to trouble myself with the Cocoa framework and dealing with Objective-C and all that bliz-blaz simply to render OpenGL.
You’ve presented GLUT here quite handsomely – so thank you again.
– kropcke
Good tutorial, saved me from learning it the outdated and unnecessarily labor intensive way. Hit a few mild snags, but there is never anything wrong with a little debugging practice.
Hi,swiftless.
Thanks for your great effort.
How can I use 3ds max object in OpenGL?
swiftless,
i just downloaded glut and glew from the website. i use visual studio 2008. i cant find “lib” the “include” folders any help. i just using opengl 2 days so i need to get some basics.
Omg Swiftless your site is fantastic! Its so nice to see how you start with the basic amount of code to get a window (and other things) up and running. This is by far the best tutorial site I’ve seen for OpenGL. I linked my class mates to it because its just so awesome.
(You frequent one of the forums I belong to too and I can’t think of which one…)
This is a very nice tutorial. I’m studying with you.
Thanks,
Santi
is glu32.lib different from glew32.lib???
i downloaded glew from the link that uve mentioned….the folder contains many more folders and files ….what to exactly do with them???
Hi Sheetal,
glu is a group of methods which allows you to do pre-determined things, such as draw gluQuadrics or perform gluOrtho projections. glew is the OpenGL Extension Wrangler, it provides all linking between extensions and their locations in the dll files.
As for installation, find the .lib files and put them in your compilers /lib/ directory, and put the .h files in the /include/ directory.
Cheers,
Swiftless
First of all I must Thank you for your effort to prepare these tutorials.
But,as a DevC++ user(which uses mingw) beginning of the tutorial was not helpful.I know it will be hard to create a tutorial that will be best for everyone,but at least you could give some direction on how to install,how to include and link.Other than that,a big THANK you.
Hey,
Just a minor comment, there are a lot of OpenGL tutorials out there but very few give pictures with the explanations. I think you should try and include as many pictures as you can with your explanation, after all you the topic you are teaching is computer graphics! But besides that, the site is very helpful.
Hi Andrew,
That’s a great suggestion. I’ll see what I can find time for.
Thanks,
Swiftless
Minor site layout quibble – links that go the the next and previous tutorials would be a nice touch
Hi Alistair,
I had never thought of that, I will put it on my list.
Cheers,
Swiftless
Just to add my thoughts that I would very much like this as well. I know you have an index page to the tutorials, but this would be great as well.
Also that index page would be better if it made it more clear the tutorials that are OpenGL 2 vs later versions as the concepts are quite different.
Also… what is your opinion on where one should start learning – start with the OpenGL 2, or with the 3 or 4 tutorials?
Hi Nick,
If you have no computer graphics experience, then the OpenGL 2.x tutorials are a great introduction to the concepts. If you have some computer graphics experience, maybe with Direct3D, I would recommend jumping to the OpenGL 3.x and 4.x tutorials.
Cheers,
Swiftless
No actual file specified in the “include” directive in first code snippet:
#include // Include the GLEW header file
The tutorials are very clearly explained. Nice work 🙂
Hi Alistair,
Haha, I’m surprised no one mentioned it sooner.
Thanks,
Swiftless
Hi,
Thanks for a great tutorial, dont want to come across as slating your efforts, because you have obviously gone out of your way to provide a tutorial for us. However I was very confused at the start with installing the initial files, I didnt realise I had to compile freeglut to get the .dll file and the .lib file, so maybe that could be added, and also when you get to the glut main loop I thought you were saying create an infinite loop and put display and glut main loop inside, obviously realised when I saw the final source this was not the case.
Hi 4D1,
You don’t have to compile freeglut, you can download the binary files straight off of the website.
Cheers,
Swiftless
Good tutorial thnx :):)
This tutorial is fine.
One thing that annoyed me is that you didn’t give an explanation of where to locate the codes , luckily at the end of the tutorial there is a complete code that shows.
Hey,
I include the code on every page at the bottom so that it is easy to find without downloading external files. But I might be uploading visual studio projects to go along with them.
Cheers,
Swiftless
It doesnt look like anyone has had this issue so it must just be me. But when I build the above code i get the follow link errors.
__imp__glewInit
__imp__wglewCreateContextAttribsARB
__imp__wglewIsSupported
I’m running visual studio 2010 ultimate edition, on windows 7 64 bit. Ive been looking around all over the web for support with this issue but I cant find any.
Things Ive tried so far.
Re-downloading GLEW and putting the new download in the right positions
Putting the .dll in my sysWow64 as well as my system32 folder (just incase)
Linking glew32.lib, glu32.lib, and opengl32.lib to my project through Project properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
So far I have only found one similar issue to mine online, and the only offered solution was to re-download and compile the files (which I have done) Also, I had no problem with the 2.0 tutorials using visual studio 2003, I however decided to upgrade to 2010 because I get a free download through my school.
Also Great tutorials, I cant wait to be able to actually run the newer ones, and I enjoyed doing some of the earlier ones. 🙂
Hey Dennis,
It sounds like you have checked everything out which could be the cause, and those are link errors you have posted, which means something isn’t being linked correctly for the glew library.
Have you got the .lib files in the correct folders?
If so, then I am not sure what is wrong as I am using the same system setup, eg: windows 7 64bit and visual studio 2010.
Cheers,
Swiftless
hi! tnk 4 post all that!
I’ve a big problem (cant sleep the night): i know good Ogl… infact wrote a grphEngine (CoiAxis) Using the tlb for OGL with vb6, but resources are too limited… 4 this want try to implement some using c++. I followed all your tip and istructions, but when try to write 1st row:
#include
suddenly appear on error list ‘100 errors’ all same to ‘this declaration may not have extern ‘C’ linkage’
why???
heyy .. thanks for this great effort , but i have problem here ..
Error 1 error C2065: ‘running’ : undeclared identifier
in this sentence :
while (running) {
display();
}
and yhank u
Hey Aya,
This is example code to give an idea about how this works under the hood for glut. The code isn’t actually needed for the tutorial.
Cheers,
Swiftless
1. glutCreateWindow (“You’re first OpenGL Window“); // Set the title for the window
Dude that should be your*
Not often that people mess up in that direction with your/you’re
Hey asdfgasdfg,
Thanks for the heads up, it’s not often i have grammar issues either 😉 this one I blame on rushed coding and possible spell check 😛
Cheers,
Swiftless
I like to think of it as “You’re the first window” – something beginning programmer would say once everything has compiled and linked properly.
and I say “Asdfgadsfg” should really be “stupid”
thanks! but i always have this error :
Error 1 fatal error C1083: Cannot open include file: ‘GL/glx.h’: No such file or directory c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1
what should i do?
Tienes un error de linkeo… kiere decir k te falto linkear las librerias k rekieres para usar glut. Eso se hace de diferentes maneras dependiendo de la IDE k uses… si usas konsola, no tengo idea.
Everything else works, but it says: “Program cannot run because freeglut.dll is missing from your computer.” I have it on my system32 directory. What should I do??
Hey Daniel,
Are you running a 64bit version of Windows? If so you will have to use the SysWOW64 folder I believe. If that doesn’t work, try the System directory. And as a last resort, you will need freeglut.dll in the same directory as your compiled exe file.
Cheers,
Swiftless
I do have 64bit windows. ^^ Working!
Everything working fine, but exported file gives me an error “Function called without first calling ‘glutInit'” I have glutInit(&argc, argv); in my code and it’s the first command in main() function. What’s wrong now?
Wonderful !!!
This is very good wen site for my students to
learn OPENGL Programming.
Ya !!
Many Thanks,
Good !!!!!!!!
Reader: Dr. Shao-Shin Hung
I think you should also include to set subsystem or system of linker from window to console because i got this error : MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
and I followed instructions of this page
http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/14e85604-6929-4707-a22e-8cdf596926a6
the error happened at the point where you just put a window and tell to test it
Hi Lmrn,
You will only get WinMain errors if you created the wrong type of project. You need to create a console application, not a windows application.
Cheers,
Swiftless
I`m having trouble finding how to setup freeglut, there are no instructions to set it up on windows
Nice tutorial, but why don’t you indent your code? :s
Hey Alcuadrado,
I do comment my code, but putting it into wordpress removes the indenting, and it takes too long to put it back.
Cheers,
Swiftless
Oh yes, wp sucks in that aspect, what a pitty..
I’ve just finished a year at university studying programming. I did a little openGL so I knew a little of this when I started. I got cofused about exactly where the function calls and code pieces were meant to go, and you seemed to miss the part where you set the glutDisplayFunc(), which threw me. Other than that, this is well set out and goes at a good pace to keep me always interested. Well worth looking at – even if you think you know the stuff.
Hey Chris,
I’m glad to hear you like the tutorial. I have since added the call to glutDisplayFunc into the tutorial for other readers.
Cheers,
Swiftless
Great blog mate, keep it up. I am currently following your tutorials and I got to say that they are way better and shorter than NeHe OpenGl tuts out there. 🙂
Nice tutorials man. I went lot deeper in to your samples. It was really good. I have one query here.
Can we do OpenGL coding without using glut? ie with out the inbuilt APIs for drawing shapes.
Keep posting tutorials, I would like to know start learning OpenGLES.
-anoop
Hey Anoop,
GLUT is only a cross-platforum windowing toolkit, therefore all of the OpenGL calls we make are independent of GLUT. Those inbuilt APIs for drawing shapes make calls to glEnable and glVertex calls like regular drawing in OpenGL. For creating a cube, you can plot the points out on paper and enter them in, or there are plenty of examples on the web. For the sphere, I have a tutorial on drawing them without GLUT. But for more advanced shapes, you will generally want to use a model loader of some sort.
OpenGL ES is a lot like OpenGL 3.0 and 4.0, going for a shader based approach, and is used in mobile phones and consoles such as the Playstation 3. I won’t be making OpenGL ES tutorials, but I recommend you check out the new ones when I put them up shortly.
Cheers,
Swiftless
Hmm!!
Thanks for the info…..actually I am working with iPhone…so was trying to dwell into OpenGLES….I have bought some books but it is quite different from OpenGL. Let me see how far I can go…….anyways keep up the good work..
-anoop
Absolutely fantastic! After a bit of initial headscratching I got it to work. The problems that arose were just my lack of experience with VB, now I know what the hell is going on it makes a lot of sense.
Cheers for the good work. 🙂
i read this first lesson on many other sites.seems like this one is always the simplest to learn.
Anyway, i really like this web-site for its easy and hospitable-to-new-ideas design,hopefully,we can learn lots of stuff from it.
Best regards!
“You are first OpenGL Window”
No, no I am not.
Grammar aside, good guide. First out of about 10 tutorials that I got the first lesson to compile and run.
To compile on Visual Studio you need to set the subsystem to windows with:
#pragma comment(linker,”/SUBSYSTEM:WINDOWS”);
and reset the entrypoint to main again with:
#pragma comment(linker,”/ENTRY:mainCRTStartup”);
(cause setting subsystem to windows will cause entrypoint to require WinMain, wich is undesireble).
Hi BrainStorm,
I am not sure of your setup, but with Visual Studio, from version 6.0 to 2010 (including 2005 and 2008), I can guarantee that if your headers and dlls are in the correct folder, and your libraries are linked correctly, and you are using a console application (a WinMain application has problems with GLUT) then the above code will copy and paste to compile.
Cheers,
Swiftless
Hey people having issues compiling color commands:
I had the same issue and also linked libopengl32.a and libglu32.a using MinGW
now everything works (I linked these after glew and freeglut)
Hi Garet,
I am not too familiar with MinGW. Glad you got it to work though.
Cheers,
Swiftless
Ok, it didn’t display the way it was supposed to, but I hope you know what I mean.
Hey Exxon,
Yes, you need to use standard quote characters for strings and character arrays, not those dodgy things HTML use 😛
Cheers,
Swiftless
glutCreateWindow (“You’re first OpenGL Window“); // Set the title for the window
won’t compile, because it needs “…” instead of “…“ . It’s fixed in complete code at the end, however:)
lol am yet to check this
I will be back later
Hey,
That sounds weird, try changing your glutInitDisplayMode line to glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
If that doesn’t work, and all your code is identical to the code above, then it sounds like a driver issue.
Cheers,
Swiftless
my code is :
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
it doesnt mather if i palce a 1 or a 0 it still stays blanck
I have a problem with ure code, i have a white background and not a red one, did everything from ure fantastic tutorial, but only the beackground is not good
Hi Lonelobo,
Does your glClearColor line contain all 1’s? Or is it glClearColor(1.0f, 0.0f, 0.0f, 1.0f).
It should look like the second one to give the background the colour red. All 1’s will make it look white.
Cheers,
Swiftless
Hello there! I figure it out. It was just I was leaving the glutInit part out of the int brackets and the compiler was telling me something was wrong and I thought maybe i had them installed wrong. But now it runs smoothly and moving on to the second tutorial 😀
Thanks,
Expora
Hello there!! The past 2 days I’ve been trying to start studying and learning about openGL but i stumble across multiple problems finally I found your tutorials but id like to know how you install glew and freeglut so i dont get into any problems.
Thanks,
Expora
Hi Expora,
I give a quick rundown of how to install both GLEW and FreeGLUT in the tutorial, towards the top.
If you get any specific problems, let me know.
Cheers,
Swiftless
Thanks for the well explained tut.
I found a little thingy. In Line 19 of the full code you use glutDisplayFunc(display); , but you never said anything about it beforehand.
Nice tut, will continue reading!
Very good tutorial for opengl.
I am working on GPU-accelerated 3D ultrasound imaging and i have to start with opengl and glsl.
Your tutorial really saves me a lot of trouble digging in textbooks.
Really appreciate your effort!
Good luck!
Prince Ma from China
Great tutorials! I’ve been looking all over for opengl tutorials, or more specifically glut tutorials and I’ve been hard-pressed to find any made even within the last 5 years. The fact that yours were made so recently is awesome. Keep em comming!
Thanks! 🙂
Seems like, that here is no forum ? Maybe you should make one, where other people could post their projects, ask for help etc. 🙂
I tried having a forum once, but no one (literally) used it. Since re-doing the site though, I will try adding one again and see how it goes.
Cheers,
Swiftless
Greeting!!
Thanks a lot for those perfect samples and explanations! I’m just trying to learn openGL and i think,that this site will be very ( very very) useful for me. Maybe u can post some books, from what you learned ? Or sites? Seems like that GL library’s contains a million of functions, would be gr8, if could understand, what each function means 🙂
Anyway, GL ( good luck this time 😀 )and keep up the good work!
Hi Wish,
Thanks for the comments! It’s always great to hear people benefitting from the site.
I mainly learnt about OpenGL through the online API once I got past the basics.
I would however recommend the following books for starting OpenGL and GLSL:
The Red Book – For OpenGL
The Orange Book – For GLSL
And the following sites for getting started with OpenGL:
NeHe Tutorials
LightHouse3D
Apron Tutorials OpenGL
Game Tutorials
Hope this helps,
Swiftless
Hi Cody,
Sure thing, I will post the completed source code at the bottom of this page. It should be on the bottom of all the other pages, but since rewriting this one, that is one thing I forgot.
Thanks,
Donald
I really like your tutorials… I’m already learning alot.. The only thing I wish you would do is to add the completed source code at the bottom of each… that is all… but other than that thanks