I want to define a region (for mouse detection ) and a mask for drawing a simple 2D sprite ?
i define a BMP file(24 bit) with the sprite or button,and a second BMP file(24 bit) with the mask (black and white).
i want to draw the sprite only if the pixel in the mask is black.
i want to define a fonction how draw the sprite :
you load the sprite BMP image in a screen buffer
you load the mask sprite BMP image in a second screen buffer.
the fonction draw the sprite
a second function define the Region detection of the sprite ,with the mask(black/white)BMP file , and scale the region and the front screen buffer.
if you want to change the drawing of the sprite and is corresponding black/white mask, for example ,i draw a rectangular button fisrt, and at the end, i want to do an ovale button,i just open photoshop, i redraw my ovale button,in a BMP file (same name) , i redraw the black and white mask in a BMP file (same name) ,and the graphisme of my game haved changed !
the detection of the sprite region and the draw of the sprite haved changed automaticaly !
it 's possible with opengl ?
i obliged to define polygone for sprite or button in a simply 2D game ?
i haved find documentation on standard function,but nosample code or tutorials demonstration of 2D exploitation !!!
nothing on 2D sprite !
it’s more simple to do a complex 3D object than to do a simple 2D sprite !!
i haved choice opengl since a thinking its better for the portability, and when you devellope on PC ,its the only solution to draw in full srcreen ,did you try to devellope MFC program ? (it’s to hard to devellope on PC ,the code are to ?/§!!/à@)
a gaz station !
i dont want to use DirectX
i haved devellope a 2D game on Macintosh, i have find documentation sample etcc…
my game working good ! (powerPC MACOS 9)
and i use the technique of BMP masking for the sprite and region !
i can redraw all the sprite of my game and the mask !
the detection of the region change automaticaly
i read documetation on STENCIL BUFFER ,it may be the solution ? how it work ?
i dont find any sample on 2D, simple image and mask !
i dont want to define polygons for my 2D sprite its to hard (and if my sprite is complex ,i have obligate to define many polygons for only a simpple 2D sprite!)
so help please !
i am beginer on opengl ,but i know how to load bitmap(24 bit),draw the bitmap on a fullscreen opengl, detect mouse and kayboard events .
i dont find sample code on how to exploit 2D with opengl !
[This message has been edited by willy (edited 02-13-2003).]