|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Game developing./CODE |
|
|
|
|
|
|
|
|
|
|
|
|
News |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Styles |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Here I'll post code samples from the engine. stay tuned. |
|
|
|
|
|
|
ME!!! |
|
|
|
Email: |
|
roamfire@icqmail.com |
|
|
|
Feedback people, I need feedback. just write about the demos so far. |
|
|
|
Let the code begin |
|
|
|
|
|
ok, the above code initializes the DirectDraw object pointers, required for the drawing, they are: 1. IDirectDraw7 - the DirectDraw main event, (the pointer is named m_pDirectDraw, surprisingly well named.), this baby will help us create all other objects. 2. IDirectDrawSurface7 - this is our drawing board, in the code I've called it m_pDirectDrawSPrimary and m_pDirectDrawSBack, named after the primary surface and the back buffer surface. 3. if we are in a windowed mode, we'll also create a clipper for the window, so that our graphics doesn't overflow on the desktop.
at the end of the function there are four member variables that hold the drawing clipping region, so that we can clip our drawing inside the visible part. more will come... |
|
|
|
|
|
|
|
Here is our basic blitting function, first we setup the destination rectangle, considering the internal clipping region. In case the surface was lost I attempt to restore the surfaces.
When all the blitting is done, (the back buffer is ready to be displayed) I flip the surfaces and the verical blank signal. |
|
|
|
|
|
|
|
Hi again. If you had the time to download the latest demo, you might have noticed that there is a circle of light following the robot, And you might have wondered how was it done. well, first I created a 2d array of char's, that is the pShader pointer, then each element was given the light increase value, which ranged from 0 to 80. now each time I draw the scene, I call the function below after the ground map is drawn. the f(x) below is very simple and specific, it draws only for 24 bit surfaces. |
|
|
|
|
|
|
|
here is a small tutorial on how to find what tile my mouse is over. without too much math stuff :) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|