Jump to content
  • Advertisement
Sign in to follow this  
coden4fun

SDL_OPENGL vs SDL_DOUBLEBUF window OpenGL Errors, Glitches whatever ya want to call

This topic is 4006 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'm on lesson 36? with Lazyfoo.net tutorials, and I need to link glu32.lib and opengl32.lib; however, I don't seem to have them in my library folder. Can someone please help? Look at the last post I've posted I believe I have nailed the problem now it's time to solve the problem. [Edited by - coden4fun on October 30, 2007 10:24:37 PM]

Share this post


Link to post
Share on other sites
Advertisement
It becomes more weird and more weird. I found the files opengl32.lib and glu32.lib and built the solution no errors, but when it tried and load the window it took forever and crash Visual C++.

How come?

What is the proper way to add OpenGL support in SDL?

Share this post


Link to post
Share on other sites
Which IDE are you using?

Which library folder are you looking in?

Assuming you're using Visual c++ 2005 express edition, you will also need the platform SDK ( however if you have done the other 35 lessons then you already have this ). Those librarys are found in the platform sdk lib folder. Make sure they are vc++ search directory.

Tools->Options->Projects and Solutions->VC++ Directories->Show directories for: Library files

Share this post


Link to post
Share on other sites
I do have the other SDK's and I've been working in SDL for about 3 months and have been working on this game engine for around a month give take a week.

And once I realized I couldn't use real time rotation with just SDL that I needed OpenGL I knew lazy foo had a tutorial that showed you how to throw OpenGL in your SDL Project, so I tried it.

I'll work on it as this weeks project, and if it goes sour then I'll do something new until I get it correct.

Share this post


Link to post
Share on other sites
AHHHHHHHH

So I figure I would show some code that is bothering. I first just did by example of lesson 36, and I double checked that I had the right library, and used the right headers, and then I realized not having any syntax errors, or compiling errors that I had to have the correct libs linked, and headers included, so here is what I found messing with the code.

If I try this initializing OpenGL before, or after I get a window created, but nothing but a window, no background images I have drawn, no background color I have used with glClear(0,0,0,0); or nothing just a window that doesn't move, that has some type of glitch of the window behind it being viewed in the actual window I know you've seen the glitch, so I refuse to continue with a bad description.

SDL_SetVideoMode( w, h, bpp, SDL_OPENGL );






Now If I initialize SDL and OpenGL and instead of having an OpenGL window I have just a SDL Double Buffer Window like below the program works just fine


SDL_SetVideoMode(w, h, bpp, SDL_HWSURFACE | SDL_DOUBLEBUF);






So I ask how come these 2 lines both supported, both I could use in my project one is messing me up and the other one isn't. What is wrong?

Is it the fact that I'm creating images, and blitting the images on the screen with SDL_blit(); ? and I'm flipping the screen

SDL_Flip(screen);

What is it?

Share this post


Link to post
Share on other sites
So what do you use SDL for then? If I use OpenGL for rendering, and putting images on the screen do i need to use OpenGL to load images on the screen as well?

I mean If I need to use OpenGL for all of that window, rendering, and throwing images in the window what's the the point of using SDL?

Share this post


Link to post
Share on other sites
Quote:
Original post by coden4fun
So what do you use SDL for then? If I use OpenGL for rendering, and putting images on the screen do i need to use OpenGL to load images on the screen as well?

I mean If I need to use OpenGL for all of that window, rendering, and throwing images in the window what's the the point of using SDL?


OpenGL is for rendering only. It has no support for opening a window, loading images, handling input, playing sound, networking etc. SDL can be used for all of that.

Share this post


Link to post
Share on other sites
Quote:
Original post by Simian Man
Quote:
Original post by coden4fun
So what do you use SDL for then? If I use OpenGL for rendering, and putting images on the screen do i need to use OpenGL to load images on the screen as well?

I mean If I need to use OpenGL for all of that window, rendering, and throwing images in the window what's the the point of using SDL?


OpenGL is for rendering only. It has no support for opening a window, loading images, handling input, playing sound, networking etc. SDL can be used for all of that.


Pretty much. SDL provides a nice and safe window context for OpenGL to render to without having to muck around with Win32 or whatever other horrid API is native to your system. It also has a fairly robust input handling system, and can play your sound if you don't wanna mess with OpenAL.

SDL can also be used with DirectX, which I find to be pretty handy.

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!