Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Displaying a custommade buffer in a window

This topic is 6018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :-)

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post

Link to post
Share on other sites
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 :-)

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!