Original Post
🔒 Locked
LPDIRECTDRAWSURFACE :: Release()?
Advertisement
No. I''m trying to deallocate IMAGES. The primary and back surfaces are SCREENS. There''d be no reason to delete them (except in WM_DESTROY). For example, when the title screen clears, buttons and logos should be deleted. And images should be freed between stages. My question seems pretty clear.
Assume Image is an LPDIRECTDRAWSURFACE of class Sprite. This ends the program:
Sprite :: ~Sprite()
{
Image->Release();
Image = 0;
}
-Sagat
Assume Image is an LPDIRECTDRAWSURFACE of class Sprite. This ends the program:
Sprite :: ~Sprite()
{
Image->Release();
Image = 0;
}
-Sagat
There''s no distinction made between IMAGES and SCREENS. A DirectDraw surface is a DirectDraw surface, regardless of whether you''re using it to store images or render frames of animation. I don''t see any reason why you couldn''t just create a set of surfaces in the beginning of the program, and then apply images to them as you needed, and release the surfaces at shutdown time. But releasing a surface in the middle of a program is really no different -- it''s not like the program knows whether it''s about to be finished or not. You just call the Release() method, like you''re doing. The only problem would be like goir said, if you do this to the primary surface or something like that. If your program crashes when you call Release() for a regular offscreen surface, then you''re doing something else wrong.
-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.
Make sure that the surface is != NULL when you try to release it, this causes apps to end immediately.
Digital Radiation
Digital Radiation
Image and screen are my terminology. They''re both 2D pixel arrays, but a screen points to the VGA. It makes perfect sense. If you knew much about game/graphics, you''d know an image, screen and "surface" are the same. Stop trying to prove how smart you are, just because you cannot answer a question.
PS: Thanks Digital!
-Sagat
PS: Thanks Digital!
-Sagat
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement