Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to do something like dbSprite

Author
Message
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 11th Jun 2008 20:51
How do you draw images without DarkGdk? I've been looking, but nothing seems to work.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 11th Jun 2008 21:03
Nothing? Really? Windows uses sprites all the time, only they are called BITMAPS in Windows. If you want, I can post a 16-bit Windows application for a 2D arcade game I wrote too many years ago. It takes a fair amount of work to do, however. Are you up for it?
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 11th Jun 2008 21:06
Yah please.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 11th Jun 2008 21:19
My first question is...are you using GDK in this project, or is it a Win32 project that otherwise will not use GDK?
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 11th Jun 2008 21:38
Well, to tell you the truth, I'm trying to stay away from DarkGDK for now.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 11th Jun 2008 22:00 Edited at: 11th Jun 2008 22:32
Okay, then...that makes it easier. The first file is a resource compiler source file. You do not have the capability of making them easily in VS2008 Express, which is too bad, but I can help you with that part.

This file will be named the same as your project name. In my case, it is named ASTROB.RC In your case, you will replace astrob.h with resource.h :



Next is a file that in my case is named ASTROB.H, but in your case will be named RESOURCE.H :



The next file is the main source file. Mine is named ASTROB.C, but yours should have the extension .cpp :



You do not have the bitmap files, but...use 24-bit BMP files; they will work. If you have an option of saving as .DIB, I'd recommend that you use that, and rename the file to use the extension .BMP If you do not have that option, just use 24-bit BMP, and it will work the same.

Somewhere, I think I have an executable of this with animated sprites. For now, just look at how the .C file works. You need to pay particular attention to the LoadBitmap function, and also study how I blit the bitmap to the display in the WM_PAINT message.

This is basically how GDK does it....or, so I think. GDK probably draws the 3D surface, then uses a similar approach to blit the 2D stuff, which is probably why 2D slows down 3D to various extents, depending on how you write your game loop.

If I find the executable, I'll post it up.

Oh, and you will add the .rc file and the resource.h files in Solution Explorer. I can show you how.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 11th Jun 2008 22:11 Edited at: 11th Jun 2008 22:13
Well I never! My Yahoo briefcase was good for something, at least!!!! Here it is...my very first 2D arcade game....I compiled it in 32bits, and posted it to Yahoo a few years back!

Controls LARROW/RARROW/UARROW/DARROW = MOVE
SPACE = FIRE
B = Smart Bomb

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-29 23:25:33
Your offset time is: 2024-09-29 23:25:33