Displaying a custommade buffer in a window

Started by
1 comment, last by smokes 22 years, 2 months ago
Hi there :-) im developing this simple 2D tile shooter using DDraw 7 and have made a map editor too. Well my artist keeps complaining about my map editor being crappy and his right.. I''m a bit too lazy to do file requesters and such myself (have a simple gui with buttons, labels and textfields which is not really upto the job).. well I found a version of borland c++ builder on my harddrive the other day. As many of you probably know the Visual Component Library (a wrapper for the win32 api) is really easy and fast to use (although you programs becomes pretty huge :-). Well enough talk.. my question to you is this. In my tileset I store the tiles as simple raw buffers containing 2 bytes for each pixel (16 bit RGB565 format).. if I have a simple buffer how do I display it in a windows window? you probably find this question pretty lame but I hate the win32 Api.. all these structs are too confusing :-)
Advertisement
two ways to do it.
if your primary surface is in 16 bit, just do a Lock() on the surface and transfer you tiles manually. but this is even more lame than your question...
or you can create DIBitmaps for you tiles, transfer them to a ddraw surface(s) using GDI (ddraw surfaces have GetDC() func) and then blit from these surfaces to your primary (or back surface).

have fun
nope.. you misunderstood my problem.. I got a buffer like:
unsigned short Image[5000] (example)

containing raw 16 bit data. DirectDraw isn''t involved at all.. I have kindda solved my problem.. creating a 16 bit DIB section and copying my image data to it.. only one problem.. my colors are all wrong.. my image data format is 16 bit RGB565.. does windows use 555 (or 15 bit) format internally?

and to anonymous poster:
Im am not a complete idiot so please don''t treat me like one :-)

This topic is closed to new replies.

Advertisement