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

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Aspirer
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 47
Joined: Tue May 01, 2012 8:20 pm

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

Post 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?
Last edited by Aspirer on Mon Jun 04, 2012 10:47 pm, edited 1 time in total.
"We got more information out of a German general with a game of chess or Ping-Pong than they do today, with their torture" --Henry Kolm
DatamancerStudios
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 30
Joined: Sun Sep 11, 2011 4:27 am

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

Post 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!
Benjamin100
ES Beta Backer
ES Beta Backer
Posts: 250
Joined: Tue Jul 19, 2011 9:37 pm

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

Post 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.
Aspirer
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 47
Joined: Tue May 01, 2012 8:20 pm

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

Post 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 ==========
"We got more information out of a German general with a game of chess or Ping-Pong than they do today, with their torture" --Henry Kolm
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

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

Post 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.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Aspirer
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 47
Joined: Tue May 01, 2012 8:20 pm

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

Post 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!
"We got more information out of a German general with a game of chess or Ping-Pong than they do today, with their torture" --Henry Kolm
User avatar
short
ES Beta Backer
ES Beta Backer
Posts: 548
Joined: Thu Apr 30, 2009 2:22 am
Current Project: c++, c
Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
Programming Language of Choice: c, c++
Location: Oregon, US

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

Post 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.
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
DatamancerStudios
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 30
Joined: Sun Sep 11, 2011 4:27 am

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

Post 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".
Aspirer
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 47
Joined: Tue May 01, 2012 8:20 pm

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

Post 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!
"We got more information out of a German general with a game of chess or Ping-Pong than they do today, with their torture" --Henry Kolm
Post Reply