Jump to content
  • Advertisement
Sign in to follow this  
VahnRPG

Delusions of 2d grandeur - OpenGL or DirectX?

This topic is 4862 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

I've been a programmer for the past 5 years or so, but most of it has been basic c++ stuff (console work and soforth) or z80 ASM (TI-graphing calc stuff) and I'm looking to increase my abilities. What I believe I am lacking is graphic programming things, so I've picked up a couple of books and read some tutorials but I become frustrated because most of it seems to focus on programming in 3d. So, I looked at SDL and Allegro and they seemed...I dunno...TOO easy. Strange as it may seem, I kind of want to struggle and become frustrated with OpenGL or DirectX in trying to make even the simplest of programs. And I know it's possible to do 2d in those, but I'm not sure which would be better to go. I'll be blunt with you all. I played Cave Story, love it to death, and I want to make my own game similar to that. However, as far as I know, that was made in DirectX and it looks great. From what I've heard, OpenGL is good for portability and whatnot, but at times it seems TOO frustrating. My sprites will probably be 16x16 pixels, and OpenGL seems to be all about the floating point. I've got no clue what to do it get it smaller and...I dunno...am I looking in the wrong places for help or just not paying attention to what I should be doing? And is DirectX any better in that respect? Tho apparently DirectX and its APIs are slower compared to OGL? Does anyone understand what I'm trying to say? Cuz I think I lost it @_@ Thanks!

Share this post


Link to post
Share on other sites
Advertisement
They both can render textures makes no difference, openGL calls have less overhead.. you should try looking at nehe and learning some of the basics.

Share this post


Link to post
Share on other sites
Actually, that's where I first went to to learn but became frustrated because it seemed to focus more on 3d than 2d :/
That and I went through the first 7 or so tutorials and realized I hadn't learned a thing...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I don't really understand where you're having problems. You do 2D the same way you do 3D.

Share this post


Link to post
Share on other sites
Quote:
Original post by AndyPandyV2
They both can render textures makes no difference, openGL calls have less overhead.. you should try looking at nehe and learning some of the basics.


Less overhead? Can you explain that please?

Share this post


Link to post
Share on other sites
2D is just a special case of 3D, where everything is facing the camera. Z values don't even need to be the same, since you can use them to achieve layering affects very easily. The only thing to change is to use an orthographic projection (that's gluOrtho2D or D3DXMatrixOrthoLH, depending on your flavor). Heck, you can even use 3D objects for effects if you want.

Share this post


Link to post
Share on other sites
Quote:
Original post by Konfusius
Quote:
Original post by AndyPandyV2
They both can render textures makes no difference, openGL calls have less overhead.. you should try looking at nehe and learning some of the basics.
Less overhead? Can you explain that please?

Simply put, you can call DrawElements a thousand times per frame without being massacred. Your performance won't exactly be ideal, but it will hurt much less than it would in D3D, which carries much more setup overhead per draw call. (Most of the OGL setup overhead is actually in VertexPointer, at least on NV.) D3D provides instancing to deal with that problem, of course, which OpenGL completely lacks.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I don't really understand where you're having problems. You do 2D the same way you do 3D.


EDIT: nvm. think I got it :)

[Edited by - MrBushido on November 21, 2005 1:41:16 PM]

Share this post


Link to post
Share on other sites
You can also treat GL window as 2D screen and draw with pixels like you can in any 2D raster gfx environment, say windows gdi or DirectX's DirectDraw for example.

Share this post


Link to post
Share on other sites
Manipulating individual pixels using glDrawPixels et al will be a whole lot slower than drawing a load of 2d textured quads (or indeed any kind of shape). If you're going to do that, you may as well use SDL or DirectDraw.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!