Skip to main content
gamedev.net
🔒 Locked

DDLoadBitmap limits

Started by OregonGhost 10 replies 700+ views
Original Post
OregonGhost
OregonGhost
I have the following problem: I want to load a bitmap with 2048x64 pixels (it''s a sequence of 64x64 bitmaps) with DDLoadBitmap. Well, it works if I load it as a 800x64 bitmap, but not with the full width. What are the limits of DDLoadBitmap and what can I do to avoid them? MfG, Oregon Ghost
______Oregon Ghost---Wenn NULL besonders gross ist, ist es fast schon wie ein bisschen eins ;c)if NULL is very big, it is almost like a little ONE.
kersh
kersh
Hello:

What is the function DDLoadBitmap? It is not API, where did you get it?

Does it load a bitmap and return a pointer to a surface? If so, than the only limitation would be the hardware that allows the certain size of a surface.

If not...Does the DDLoadBitmap return a handle to a bitmap that you need to load to a surface?

Usually to load an image like that size (2048x64) (whether it is an animation of explosions or whatever), you should make the texture as square as possible and select the UV coordinates off the square texture.... Something like this...:

That is probably 32 frames.. right?
texture size should be something like this:
512 x 256

this means that you can fit 8 acros the top (512/64 = 8)
and 4 down 256/64 = 4;
for a total of 32 frames (8*4)

than you will need to calculate the frames UV coordinates when you need them. That is usually the fastest operation.

Hope this helps,
--Jeff
acw83
acw83
I think DDLoadBitmap is an evil brought into this world by Andre Lamothe. How irritable.
DekuTree64
DekuTree64
Nope, it''s in the ddutil file that comes with the DX SDK. It just loads a bitmap and returns an IDirectDrawSurface, but can be modified very easily to return a surface7 (just add 7 to the end of all of them)
Handy file, especially for Win32 newbies that can only do text programs in DOS (that being me a few months ago)



-Deku-chan

DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)

"I'm dropping like flies!" - me, playing Super Smash Bros. (and losing)
"What fun!" - me, playing Super Smash Bros. (and beating the crap out of somebody)
furby100
furby100
The problem is possibly that your video card does not support wide surfaces, and so when it tries to create a surface bigger than the primary surface it fails. You should reduce the size so that it is within the size of the primary buffer.

------------------------------
#pragma twice


sharewaregames.20m.com

outRider
outRider
DDLoadBitmap stinks, its got problems with the width of your images, it happened to me too, so you should find another bitmap loading function somewhere or write your own

------------
- outRider -
DJ_House
DJ_House
Why would DDLoadBitmap "stink". There''s absolutely nothing in the code that locks your surface width at a certain value. I use DDLoadBitmap all the time with no problems at all. Actually it''s better than other code I''ve used for bitmaps. You have to add in the flag in the above post. I''d avoid wide surfaces anyway as a lot of video cards don''t support them.
furby100
furby100
You don''t have to add the above flag, but when you call IDirectDrawSurface7::GetCaps if that bit is set then your driver supports wide surfaces, and you can use them just as normal, otherwise you cannot use them at all.



Please state the nature of the debugging emergency.


sharewaregames.20m.com

OregonGhost
OregonGhost
Thanks!

I didn''t know that some cards do not support wide surfaces. Now I use more square bitmaps.

MfG
OregonGhost
______Oregon Ghost---Wenn NULL besonders gross ist, ist es fast schon wie ein bisschen eins ;c)if NULL is very big, it is almost like a little ONE.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.