Advertisement

Windows API

Started by April 22, 2020 01:51 PM
27 comments, last by Steeeve 4 years, 5 months ago

Frob! That's what I needed to hear! I missed the whole time when all this was developed; I'm living in the past. I do love “learning exercises”, which is how I've learned everything over the years, but you're right. I've already been there and done that. I'll join the present and start using a major engine like you say. Thank you. what I want to write is like a simulation, with terrain, animals, and you as an explorer. I guess I'll pick an engine next, and get started! I do love programming.

Steeve

Hello Steve

I am using Windows Api with Mingw and i am interested in your programs .

Would you like to share some of them .?.

you can post them on my site too.. https://aurelsoft.ucoz.com

Advertisement

Hi Steve loking nice i am also using wiapi ,but i cannot compile your code without

#include "mapping.h" do you can post this include?

thanks

You can easily acheive 1000 frames per seconds using plain software rendering on a memory buffer, unless WoW64 adds a 50X slowdown from emulating 32-bit systems. Then you can separate window management using a module for MS-Windows and easily port to Macintosh and Linux in the future. OpenGL and SDL would be complete overkill for a project like this and probably end up much slower with more bugs and crashes. OpenGL does not like pixel-exact operations and will give you black seams when moving to another computer unless you rely on extensions or newer core versions that might not be installed. Direct3D has volatile memory causing buffers to become black at any time a device is lost.

When moving past beginner graphics, you can just generate any image you want in memory using multi-threading and SSE for deferred light, normal mapping and depth based shadows. Then upload the result to the whole window using a background thread while doing game logic for the next frame. By having both pixel-exact operations and non-volatile memory, most of the rendering can safely be passive and still flicker free.

@frob Makes sense. I'm enjoying “creating” a game engine as I go, but if I'm the only one doing it, I won't get any help, and won't learn anything new. The game is the point; I'm trying to create a world simulation, and then make a treasure hunt out of it, and a pirate ship battling game. I want a world first of all, with terrain, plants and animals, etc. As life-like as I can make it and with some AI in it so it is alive and modifies itself. Will try Unity next, I guess.

Steeve

@aston2 I am in the middle of a major change, so nothing is working at the moment. As soon as I get this new stuff working I'll post/send/? all of my code, including mapping.h

Steeve

Advertisement

Steeve if you want to do also engine programming maybe you can check handmade hero( https://handmadehero.org/), is a series about making a game from scratch, there's also a forum and a community about making stuff from scratch, it's called handmade dev ( https://handmade.network/​ ), I don't know if It's ok to post this here, if not, the moderator can delete my post…
Then try also a game engine, but if you like doing your own thing go for it! I'm also doing my thing using sdl hopefully sooner I will post my stuff too!
Cheers

None

Cool! Let's keep in touch.

Steeve

@aston2 I can

‘t figure out how to post my project files here or on your website! I have everything in a zip file, but I don’t see “attach file” anywhere.

Steeve

My animation is a little crude, but the best I've come up with so far.

I redraw the background to erase the old position of the character, then AND a solid black version of the character on a solid white background into the terrain. This will "cut" a hole for the character, leaving the background intact. Then, OR the actual colored character on a solid black background into the terrain. This will insert the player, and again leave the background intact.

old = SelectObject(bitmapDC, (HBITMAP)thing_image[type][subtype][cframe][1]); // AND bitmap

ok = BitBlt(screenDC,thing[t].scrx,thing[t].scry, BMwidth, BMheight, bitmapDC, 0, 0, SRCAND);

SelectObject(bitmapDC, old);

old = SelectObject(bitmapDC, (HBITMAP)thing_image[type][subtype][cframe][2]); // OR bitmap

ok = BitBlt(screenDC,thing[t].scrx,thing[t].scry, BMwidth, BMheight, bitmapDC, 0, 0, SRCPAINT);

SelectObject(bitmapDC, old);

Steeve

This topic is closed to new replies.

Advertisement