FreeBasic Games Directory Forum

FreeBASIC Game Development => Programming => Topic started by: ecxjoe on January 26, 2011, 06:05:10 PM

Title: 2D with OpenGL
Post by: ecxjoe on January 26, 2011, 06:05:10 PM
Are there any tutorials on this subject for Freebasic? Thanks.
Title: Re: 2D with OpenGL
Post by: Brick Break on January 26, 2011, 10:47:58 PM
Are there any tutorials on this subject for Freebasic? Thanks.
No, there are not. Why the hell would you want to do this? Destroy everything we've worked for? OpenGL is for 3D games, and even then not all of them. I dread the day that we have to use OpenGL to make a game.
Title: Re: 2D with OpenGL
Post by: Mitchell on January 26, 2011, 11:27:57 PM
Not that I'm aware of, but if you're familiar with OpenGL as it is, you can look up the tutorials in C and see how to modify them there. IIRC, you mostly call the functions differently. Like glVertex3f(x, y, z) becomes glVertex2f(x, y), but it's been a long long time since I meddled with that stuff.

@Brick: If you are using OpenGL in your normal game, there's no switching back to FB's vanilla graphics (which means things like line(), pset(), and print don't work). So 2d graphics like menus and HUDs require OpenGL's 2d capabilities. Which are pretty similar to OpenGL's 3d function calls. Again, it's been a long time since I dealt with this stuff, so I may be slightly off on the details.
Title: Re: 2D with OpenGL
Post by: KristopherWindsor on January 26, 2011, 11:28:24 PM
I didn't make a tutorial, but I have done this before:
http://www.freebasic.net/forum/viewtopic.php?t=10607

Also, Brick Break doesn't know what he's talking about.
The performance with a decent graphics card is /way/ better than you'll ever see in FBGFX.
Title: Re: 2D with OpenGL
Post by: Lachie Dazdarian on January 27, 2011, 12:04:47 AM
Did you guys forget about relsoft's Easy GL2D?

http://www.freebasic.net/forum/viewtopic.php?t=16222

It's basically a FBGFX-like frontend for OpenGL. Hardware accelerated 2D gfx with all the user-friendliness of FBGFX.

You can find some tuts on it in Back to Basic #2: http://imortisoft.no-ip.org/b2b/?Issue_%232:Basic_2D_Rendering_in_OpenGL_using_Easy_GL2D%3A_Part_1

I'm making a game in Easy GL2D as a matter of fact.

Title: Re: 2D with OpenGL
Post by: Brick Break on January 27, 2011, 05:18:39 PM
The performance with a decent graphics card is /way/ better than you'll ever see in FBGFX.

That's because FBGFX doesn't have a decent triangle function. A better library would be better.

I have researched this, and standard software rendering is better than any integrated graphics, however most software rendering libraries suck because either

a) They operate on a lower level than the operating system
or b) they don't have anybody backing them up (big companies)

Also, don't speak about me in the third person.

EDIT: deleted rant
Title: Re: 2D with OpenGL
Post by: ecxjoe on January 27, 2011, 08:01:34 PM
Thanks for you help everybody!

My reasoning for this is to scale graphics onto the current desktop resolution rather than changing the resolution; switching to and back from 320x240 and 640x480 isn't a friendly experience for a lot of people...flickery, slow, messes up the icons and even resizes other open windows down. Ok, so really that's a Windows OS problem, but I don't know of another solution. So for optimum performance I want to use OpenGL.
Title: Re: 2D with OpenGL
Post by: Brick Break on January 28, 2011, 01:09:40 AM
Thanks for you help everybody!

My reasoning for this is to scale graphics onto the current desktop resolution rather than changing the resolution; switching to and back from 320x240 and 640x480 isn't a friendly experience for a lot of people...flickery, slow, messes up the icons and even resizes other open windows down. Ok, so really that's a Windows OS problem, but I don't know of another solution. So for optimum performance I want to use OpenGL.
Oh, that? Well, I'd say you should have designed it for 640x480 in the first place. If Windows wants to glitch out on you, that's its problem.