Original Post
🔒 Locked
Direct X tutorials...
Advertisement
I am writing a series on this... it starts with Windows programming in general, but you can always skip that if you know it already. Go to my site (link below) and check out the Resources section. Good luck.
-Ironblayde
Aeon Software
The following sentence is true.
The preceding sentence is false.
-Ironblayde
Aeon Software
The following sentence is true.
The preceding sentence is false.
Zed: Wow, thanks!
AP: Blitting an offscreen surface is the same with a bitmap as without... could you be a little more specific as to exactly what you can do and what you need help with?
-Ironblayde
Aeon Software
The following sentence is true.
The preceding sentence is false.
AP: Blitting an offscreen surface is the same with a bitmap as without... could you be a little more specific as to exactly what you can do and what you need help with?
-Ironblayde
Aeon Software
The following sentence is true.
The preceding sentence is false.
The AP was me... at school, once again.
Alrghty, well I''ve been having trouble loading a bitmap into an offscreen surface, and then being able to display it properly (in 16-bit).
I first setup the bitamp so it''s information is accesible, then I create the offscreen surface, next I lock the offscreen surface and finally, I use memcpy() to put the bitmap into the offscreen surface. But when I try to blt the offscreen surface to the backbuffer, which will then be flipped with the primary surface, it doesn''t work.
I don''t think my problem is blting the offscreen surface though, rather my problem might lay somewhere else like stuffing the bitmap into the offscreen surface (my offscreen surfaces using color keying). Could you maybe provide me with some working code in 16-bit that puts a bitmap into an offsceen surface and then blts it? Thanks!
twizz24@hotmail.com
If you place an infinite amount of monkeys in a room with an infinite amount of type-writers, they WILL type up the entire workings of Shakespeare
Alrghty, well I''ve been having trouble loading a bitmap into an offscreen surface, and then being able to display it properly (in 16-bit).
I first setup the bitamp so it''s information is accesible, then I create the offscreen surface, next I lock the offscreen surface and finally, I use memcpy() to put the bitmap into the offscreen surface. But when I try to blt the offscreen surface to the backbuffer, which will then be flipped with the primary surface, it doesn''t work.
I don''t think my problem is blting the offscreen surface though, rather my problem might lay somewhere else like stuffing the bitmap into the offscreen surface (my offscreen surfaces using color keying). Could you maybe provide me with some working code in 16-bit that puts a bitmap into an offsceen surface and then blts it? Thanks!
twizz24@hotmail.com
If you place an infinite amount of monkeys in a room with an infinite amount of type-writers, they WILL type up the entire workings of Shakespeare
I just use the easy way for loading bitmaps; that is, using Windows API functions rather than writing my own loader. You just don't gain much by writing out 200+ lines of code to load a bitmap manually.
Here is what I use. This is very similar to what you would find it ddutil.cpp in the DirectX SDK.
That's kinda long, but it's mostly just the same 2-3 lines over and over to release everything, heh. There are better ways to do it but that's what I have right now.
This is almost identical to the load function that is used for GDI-based programs, and so I've covered every part of this function in detail in my GDI tutorial on my website. Once you've created two surfaces, lpddsPrimary and lpddsOffscreen, you could load a bitmap and blit the image like this:
if (ADXL_LoadBitmap("text.bmp", NULL, 0, 0, lpddsOffscreen))
lpddsPrimary->Blt(NULL, lpddsOffscreen, NULL, DDBLT_WAIT, NULL);
This is all the same for any color depth, as the WinAPI functions will automatically convert the color data to work with whatever display mode you happen to be using. Hope this helps...
-Ironblayde
Aeon Software
The following sentence is true.
The preceding sentence is false.
Edited by - Ironblayde on October 24, 2000 2:25:18 PM
Here is what I use. This is very similar to what you would find it ddutil.cpp in the DirectX SDK.
|
That's kinda long, but it's mostly just the same 2-3 lines over and over to release everything, heh. There are better ways to do it but that's what I have right now.
This is almost identical to the load function that is used for GDI-based programs, and so I've covered every part of this function in detail in my GDI tutorial on my website. Once you've created two surfaces, lpddsPrimary and lpddsOffscreen, you could load a bitmap and blit the image like this:
if (ADXL_LoadBitmap("text.bmp", NULL, 0, 0, lpddsOffscreen))
lpddsPrimary->Blt(NULL, lpddsOffscreen, NULL, DDBLT_WAIT, NULL);
This is all the same for any color depth, as the WinAPI functions will automatically convert the color data to work with whatever display mode you happen to be using. Hope this helps...
-Ironblayde
Aeon Software
The following sentence is true.
The preceding sentence is false.
Edited by - Ironblayde on October 24, 2000 2:25:18 PM
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement