I want to begin programming 2d graphics. The only graphics I've ever dabbled in were java applets (which barely count). I've practiced java for a year and a half, but I know enough c++ to get by.
My question: How does one go about getting into programming 2d graphics?
>>4 >>5
Strangely enough, the chief architect behind both Allegro and XNA is the same person: Shawn Hargreaves.
The difference being is that Allegro was first designed for the Amiga when Shawn was a teenager and then ported to DOS and later Windows 9x when he was attending University.
By the time he had joined Microsoft and began work on XNA, he had 15 years of experience under his belt as a professional game and graphics programmer. The end result is that XNA is beautifully designed whereas Allegro a cobbled together pile donkey excrement.
Do modern hardware cards even offer any acceleration for 2D operations any more, or is that gone with the old days of DirectDraw and the like? I've noticed that DirectDraw hasn't even been included in the last few versions of DirectX.
>>10
DirectDraw is officially deprecated, and yes, the reason for this is that it is now more efficient to do 2D rendering in 3D.
Name:
Anonymous2010-09-28 1:21
>>11
So, something like sticking textures on camera-facing rectangles? That sucks. Is there some functionality to help get the pixels to line up 1-to-1?
2D sprites and bit-blitting were the fucking best. I guess CPUs are fast enough that you could just do that in software these days.
Name:
Anonymous2010-09-28 1:32
>>12
Libraries like XNA use custom sprite classes that do all the necessary work for the camera and mapping to screen coordinates for you. So you get easy to use, fast rendering sprites.
Name:
Anonymous2010-09-28 1:57
>>12 Is there some functionality to help get the pixels to line up 1-to-1?
That's not particularly hard. You'd never know Factor's GUI was OpenGL based without reading about it online or in the code. Or look at Compiz. Windows don't end up distorted.
>>10,12
You use OpenGL for your 2D. There's a way to make it pixel-perfect, by using glOrtho. I did some of this shit pretty successfully in the FIOC; gave me 2D RGBA sprites, smooth as my girlfriend's vagina animation, subpixel precision when I wanted it, fine rotations, fine X-Y scaling, bilinear filtering, transparency and simple vector drawing.
Python has several small modules oriented towards using OpenGL for 2D; I picked one and simplified and optimized it for my purposes. I did add display lists to it, for efficiency.
Name:
Anonymous2010-09-28 7:03
DOS is one of the most enjoyable systems for graphics programming.
Just set a point to 0xA000 (iirc) and that's your video memory. Call some bit of assembler to set the video mode and some other bit to check for vertical retrace and your good to go.
Anyone recommending SDL for anything at all is a moron or a troll. Anyone recommending OpenGL for 2D is a troll.
Allegro is great in that it's easy to get into and basically does everything you want it to. Regardless of its suitability for serious game programming nowadays (I happen to think that it's very suitable, but idiots could disagree), it's at least a great starting point.
Actually, OpenGL in 2D is nice if you want to write or use routines that can handle both 2 and 3 dimensions. That way, once you've done classic Invaders, you can then write an XInvaders clone without it being from scratch.
Name:
Anonymous2010-09-28 14:27
>>32
Anyone recommending Allegro is a moron or a troll.
C# with XNA and using SpriteBatch is the way to go.
para usar la lambda
para usar la lambda
se necessito un poco de gracio
una poca de gracio
para mi, para ti, ay arriba, arriba,
ay arriba
satori sere satori sere
yo no soy cuddero
yo no soy cuddero
soy mago, soy mago
soy mago
lambda lambda
lambda lambda
lambda lambda
lambda lambda
I'd go with OpenGL. I've used the C bindings quite a bit, but you may want to start with the Java bindings since you're already familiar with that language. I hear the Python bindings are also worth a shot.
Las usanzas de los programadores españoles son irritantes para los colaboradores anglófonos nativos y son superadas únicamente por aquellas de los programadores franceses en términos de malas prácticas en el obtusómetro.