Page 1 of 1

[SOLVED]Looking to make 3d games with opengl, but don't

Posted: Sun Jun 03, 2012 5:18 pm
by Aspirer
.Edit: If you're having problems with SDL, and a search feature brought you here, I provided a link which fixed my problem, as well as a list of things I did wrong, at my last post!

I feel dreadfully hopeless right now, because I don't know everything I need to know to make games. I can program a little in C++, I've been practicing with console programs for the past few weeks and it has gotten really old. I decided to pick up a graphics library and play around, I decided on openGL. Even though I can program, I don't know much about my compiler (VS express 2010). I found a link from opengls website to an ebook about opengl. It says I need a few libraries or something, FreeGLUT, GLEW, and DEVIL. I've DL'ed them, but I don't know what to do with them. I've installed the one exe one of them is just a folder with subfolders containing files, some are C++ header files, and the other is something with an extension called .tar.gz
I know if I wanted to make games(I do but I think I'm more interested in learning right now), I should use Ogre3d or something, but I tried that in the past and one of the obstacles still exists: I don't know how to operate this stupid compiler! Every C++ teaching resource I've used has said all you need to do to include a header into your program is "#include<header_name>" or "#include"header_name" " depending on where you want to search for it. But I know a little about the compiler, you need to tell it where to search or something.

The task of reading the documentation for the compiler is time consuming most of all and a close second is difficult! Then I've got to read the opengl ebook, which is going to take forever. School resumes in two months, I don't know if I'll have anything accomplished by then. I'm the type of person who when seeing a task which is daunting, like this, quickly realizes the facts and concedes trying.

I've learned some more about C++ since I started with ogre some time ago, maybe I should just go back to it and try again. I don't like having everything done for me though, which is another reason why I like the idea of making everything myself. I might be better off overall if someone could give me some pointers (I know you all have lives to) on the compiler.

Yeah, I know the phrase "making everything myself" requires a lot of time and patience, something I'm not good at... too damn stubborn.

What should I do? Continue with OpenGL, or go back to Ogre?

Re: Looking to make 3d games with opengl, but don't know how

Posted: Sun Jun 03, 2012 5:45 pm
by DatamancerStudios
I'd probably start off with something much simpler, like SDL.
You'll be making 2D games with it, but it's a great stepping stone and interfaces easily with OpenGL once you get to that level.

http://www.lazyfoo.net/SDL_tutorials/

Follow those tutorials and you'll be well on your way to making games! It'll even show you how to set SDL up with your compiler!

Re: Looking to make 3d games with opengl, but don't know how

Posted: Sun Jun 03, 2012 7:28 pm
by Benjamin100
If you do end up using SDL,
I found this tutorial quite helpful at times;
http://www.aaroncox.net/tutorials/2dtut ... index.html

"Lazy Foo" does seem to be the one people point towards the most,
just sharing what I found helpful.

EDIT: I think I actually used Lazy Foo's for the set up,
and the one I linked to for most of my coding.

Re: Looking to make 3d games with opengl, but don't know how

Posted: Sun Jun 03, 2012 8:35 pm
by Aspirer
Ok, I'm going to try that. When I try to compile the first tutorial, I get a series of errors. I would ask on the SDL forums, but after registering I never got an email to activate!

Here's what I got in errors:
1>------ Build started: Project: SDL, Configuration: Debug Win32 ------
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_FreeSurface referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Delay referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Flip referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_UpperBlit referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_LoadBMP_RW referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_RWFromFile referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_SetVideoMode referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function _SDL_main
1>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>c:\users\User\documents\visual studio 2010\Projects\SDL\Debug\SDL.exe : fatal error LNK1120: 10 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Re: Looking to make 3d games with opengl, but don't know how

Posted: Sun Jun 03, 2012 9:07 pm
by Ginto8
It looks like you have some linker errors. In Lazyfoo's Tutorial 1, it should tell you pretty thoroughly how you need to set up your environment in order to compile and run SDL.

Re: Looking to make 3d games with opengl, but don't know how

Posted: Mon Jun 04, 2012 7:05 am
by Aspirer
I did all that. Maybe its because the compiler gave me a message which said "The project does not have a properties sheet" or something like that? I don't know what that means, or how I would fix it.


Edit: F*CK. Mayne I'm just stupid. I am so fucking frustrated, this should be the simplest thing in the world! I can figure out how to use almost any GUI, but this is ridiculous!

Re: Looking to make 3d games with opengl, but don't know how

Posted: Mon Jun 04, 2012 10:18 am
by short
Aspirer wrote:Ok, I'm going to try that. When I try to compile the first tutorial, I get a series of errors. I would ask on the SDL forums, but after registering I never got an email to activate!

Here's what I got in errors:
1>------ Build started: Project: SDL, Configuration: Debug Win32 ------
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_FreeSurface referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Delay referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Flip referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_UpperBlit referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_LoadBMP_RW referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_RWFromFile referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_SetVideoMode referenced in function _SDL_main
1>sourceFile.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function _SDL_main
1>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>c:\users\User\documents\visual studio 2010\Projects\SDL\Debug\SDL.exe : fatal error LNK1120: 10 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
According too http://sdl.beuc.net/sdl.wiki/SDL_Quit

your not linking in sdl.DLL when you build.

Re: Looking to make 3d games with opengl, but don't know how

Posted: Mon Jun 04, 2012 10:22 am
by DatamancerStudios
Are you linking to SDL.lib AND SDLmain.lib?
If you are using Visual Studio, right click on your project in
the solution explorer( not the solution ), and select properties.
Now click the arrow next to Linker.
Then click on Input, and in the right side of the window it should have a field called
Additional Dependencies, add these to it without the quotes "SDL.lib; SDLmain.lib".

Re: Looking to make 3d games with opengl, but don't know how

Posted: Mon Jun 04, 2012 5:48 pm
by Aspirer
I just don't know how to link this, like you said. I've followed the tutorial many times, and it still won't work. I tried what Datamancer said, nothing new happened. And short, I don't understand, that link you provided says nothing about errors.

A screenshot, maybe you guys could tell me what I'm doing wrong?

EDIT: Ok so I looked up my error and got this:

http://social.msdn.microsoft.com/forums ... E930CEB52C

Then I changed my library path to x86, and it actually built! Then I got this problem: The application was unable to start correctly (oxc000007b) Click OK to close the application.

EDIT: Googled shit, don't understand it. Really need help.

Eedit 3: I figured out what I did wrong. I had DLed the x64 .dll for SDL, while my compiler is x86. I also was using an empty project, when it should have been a 2indows32 console app. There was also some inaccurate info in lazyfoo's tutorial,
I found a better one at: http://content.gpwiki.org/index.php/SDL:Tutorials:Setup in case anyone has a similar issue!