News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

2D

Started by RedXVII, November 22, 2005, 10:32:47 AM

Previous topic - Next topic

RedXVII

Im going to be making a small 2D game (tetris remake). Ive got this kinda sorted but i need to know how im gonna show the graphics. Whats to stop me using the windows api to paint bitmaps and such in my window?

What do you think? Rekon i should dig up about directdraw/directx, opengl or just use the windows api?

Thanks for your opinion fellas  :U

hitchhikr

Just avoid gdi if there's animations. Also don't use the keyboard messages.

RedXVII

Whats wrong with the keyboard messages - dont you use it in your framework?


hitchhikr

I use directinput so i don't have to worry about keys repeats delays.

u

Get "ILIX" from
www.ultranos.com/asm
it has what you need, I think
Please use a smaller graphic in your signature.

RedXVII

Thanks - ill take a look

Grrrr, considoring im farely new to programming - its kinda annoying knowing theres like 100 different ways of doing something. Like for example, doing this 2D thingymabobsie:

I could do it in directdraw(ive been reading about some tutorials on this), directx, opengl, sdl, windows api, and now this ILIX! - and they all do the same thing!

ARRGHHHH! ITS DRIVING ME CRAZY!!!! WHICH ONE DO I USE!!!


u

heh seems you haven't been in-depth of all these things. There are 3 important things about a drawing engine (beside portability, which is mostly useless here)
1) features
2) limits and lack of certain features
3) ease of use

Sure, directx and opengl have lots of features, but using them directly will only end up in a nightmare. And thus you'll stop making the game in around two weeks.
Thus, wrappers are necessary. SDL is a good example of a wrapper. ILIX is a DirectDraw wrapper, in my style.

Windows API lack features, have lots of limits, and are hell to use for games. Thus, WinAPI is the worst choice.

SDL is good - has alpha-blending, audio and joystick support... but its usability is crippled at places like

while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
                while ( SDL_LockSurface(image)) < 0 )
                        Sleep(10);
                -- Write image pixels to image->pixels -- // basically reload, recompress, re-layout the bitmap.... *rolleyes*
                SDL_UnlockSurface(image);
        }

But SDL doesn't support custom blending afaik. Additive blending is awesome, but you can't use it in SDL apps.

ILIX was designed with the idea of "usability first". A hello-world game with it is several lines long, lost surfaces are automatically reloaded - you don't have to write a damn one extra line of code. Loading compressed images is piece of cake - takes 2 lines to load a whole batch of images. The compression is lossless - some really complex images could become larger in size - but at least bitmaps in your game will never look like mud (jpg) or like crystal (gif), unless intended :) .
Though, iirc the audio support of Ilix is not implemented, and additive-blending is not internally implemented.

Next time please don't shout "where's the door" right after someone pointed it to you.
Please use a smaller graphic in your signature.

RedXVII

Wow, Ultrano - that was actually a really helpful post. Sorry about my last, i think graphics programming requires a leap of faith  :red

Yeah - i had a wee look at ILIX and like the look of it. It looks fairly simple to use; i think my trouble is that i try to use an engine and try to understand what the function actually does before i use it - hence, i dont get anywhere :/ This looks like a nice set of commands to do all that technical stuff for me - i think ill just try writing something. Eventually, maybe i will understand what the function actually does  :bg

It looks like it was made by someone on this forum, do you know who?

u

Quote
It looks like it was made by someone on this forum, do you know who?
That'd be lazy me (that's why it's so simple to use)  :red
Please use a smaller graphic in your signature.