Jump to content
  • Advertisement
Sign in to follow this  
bluknight

Setting up OpenGL, GLUT, and SDL in Dev-C++

This topic is 5122 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I currently have dev-c++ installed on my computer. I don't know how to set it up to use the opengl, glut, and sdl libraries. Are there any tutorials any of you know of that could help me? Or do you know yourself? I also need to know how to make sure the libraries work and are included when I try to compile. I've used opengl before, and I remember something about needing to link to it in the compiling options or something... I'm not sure if I have to do the same thing with the other two, and I don't exactly remember what it was for opengl either. Any help would be greatly appriciated.

Share this post


Link to post
Share on other sites
Advertisement
I won't be able to help you because I'm not using DevC++ but if you use SDL you don't need to use Glut. Or am I missing something ?

Chman

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'm not entirely sure what SDL is capable of... I know glut can make windows, and I was planning on using glut to initiate the windows, opengl to draw stuff and render the scene... and sdl to do sound, and i think it's got some libraries for internet capabilities and such...

Share this post


Link to post
Share on other sites
Go to Project | Settings. Find the Link tab. Look for the line with all the '.lib' entries and add glut32.lib (or maybe it is just glut.lib, I don't recall right now).

#include <GL/glut.h> in your code, it will include the normal gl headers, and even auto-link the other needed gl libs.

Share this post


Link to post
Share on other sites
To use SDL you have to link
-lmingw32 -lSDL_main -lSDL

and if you use additional libraries you have to include those too.
I'd look at the documentation of all the libraries.
Maybe use GLFW instead of GLUT. There are some good tutorials.

Also check if there are DevPaks for the libraries that you want.
It makes installing them easier.

You shouldn't use all of them together. You can use SDL alone for 2D stuff.
Or OpenGl combined with either SDL or GLFW or GLUT for 3d stuff.

That is just my personal opinion, but: using SDL in combination with OpenGl is weird.

Share this post


Link to post
Share on other sites
as i said before... the reason for SDL is not for graphics. I was planning on using the audio/input/internet parts of sdl...

The main problem I'm having with installing this stuff is I don't know which files go where, or what file types i need and everything...

Share this post


Link to post
Share on other sites
Quote:
Original post by Clueless
That is just my personal opinion, but: using SDL in combination with OpenGl is weird.


What makes you say that ? I've been using SDL and OpenGL together in all my projects and they work perfectly fine, under both Windows and Linux (as they're the two OSes I'm compiling for).

Plus there's a framework on Nehe's site you can use right out of the "box".

Share this post


Link to post
Share on other sites
The documentation of a library ALWAYS explains how it can be installed.
You can't ask how to install a certain library every time you want to use one.
There are the developer files that you need if you want to use the api for your own projects ...
and there are the runtime libraries that you need to run programs developed with the library.

The runtime libraries are DLLs. You have to put them into the folder with your exe file.

The developer stuff is mostly in lib and include folders.
You can put the content in the lib and include folders under you dev c++ path.

For each of the libraries you have to add something to the linker parameters in your projects.
If you want to use SDL ... as I said: -lmingw32 -lSDL_main -lSDL
If you want to use GLFW: -lglfw -lopengl32 -lglu32
If wendigo23 is correct, then maybe for GLUT: -lglut32
If you want to use audiere: -laudiere
...

I won't write what header files you have to include for all the libraries.
Try to figure out which you have to include.
It is just important that your project "knows" the include path.
So if there is a folder SDL under the dev-c++ include path you should either use #include <SDL/SDL.h>
or add the whole path to SDL.h to the "globally known include directories".
Then you only have to write #include <SDL.h>
...
If there are still any SPECIFIC question, just ask.

Trexmaster:
Using such a huge library for input, timing and maybe sound just seems weird to me.

Using audiere and glfw feels right. Maybe partly because of the licence!?
I want to create a simple engine as a static library for example.
If I'd use SDL it would be a lot more restrictive.

Using SDL for loading images ... having to convert from surface to texture ...
Not sure how to explain it. It is just strange IMO.

Share this post


Link to post
Share on other sites
Ok, here's an example of my problem...

For glut, i have three files that i believe i need for compiling, and I've also got a .dll file that i know i need to be with the exe.

glut32.lib
glut.h
glut.def

There are two folders, Lib and Include. I assume the files need to go in those two...

glut.h should go in the include judging by the types of files in there, but in the lib folder there are two types. .a and .def so that takes care of one more, but I still don't know where to put glut32.lib

...

I think .a is a special format for dev-c++ or something, but I'm not sure, and this is where much of the confusion comes from.

...

"If I'd use SDL it would be a lot more restrictive"
What do you mean?
I never really understood the license thing of SDL...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!