🔒 Locked
DDLoadBitmap limits
Advertisement
Original Post
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
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
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
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)
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)
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
------------------------------
#pragma twice
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.
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.
Please state the nature of the debugging emergency.
Thanks!
I didn''t know that some cards do not support wide surfaces. Now I use more square bitmaps.
MfG
OregonGhost
I didn''t know that some cards do not support wide surfaces. Now I use more square bitmaps.
MfG
OregonGhost
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement