|
-
May 7th, 2002, 03:11 PM
#1
Thread Starter
Lively Member
Releasing DC memory
i created a whole bunch of DC mems for a game, and at the end i hafta write something like this:
form_unload
releasedc me.hwnd, front
releasedc me.hwnd, back
releasedc me.hwnd, tileset1
releasedc me.hwnd, charset
releasedc me.hwnd, level1texture
releasedc me.hwnd, level2texture
releasedc me.hwnd, gui
etc...
is there anything that can get rid of all created dc mem, like
ReleaseDC me.hWnd, ALL?
Often talked of, never seen,
Ever coming, never been,
Daily looked for, never here,
Still approaching, coming near,
Thousands for its visit wait,
But alas for their fate,
Tho' they expect me to appear,
They will never find me here.
What's this about?
-
May 7th, 2002, 03:26 PM
#2
PowerPoster
nope. you have to store the objects and release everything its a bit complicated.. search the forums, the code has been posted.. sorry no time
-
May 11th, 2002, 08:14 PM
#3
Lively Member
It can not be done
I've tryed every single codeing technique thats been posted on the subject here. They do not work. Try running them is an endless loop of creations and deletes and you'll see the problem.
Switch to DirectX or limit the amount created so memory doesn't run out. Would be my advice.
All will fall before the might of the Black Sashi...
-
May 13th, 2002, 06:07 AM
#4
Thread Starter
Lively Member
thnx for the help. I guess im stuck with what i have until i can find a "DirectX for dummies" site. Know of any good ones?
Often talked of, never seen,
Ever coming, never been,
Daily looked for, never here,
Still approaching, coming near,
Thousands for its visit wait,
But alas for their fate,
Tho' they expect me to appear,
They will never find me here.
What's this about?
-
May 13th, 2002, 07:28 AM
#5
New Member
You can try this API function
Code:
Public Declare Function DeleteDC Lib "gdi32" _
(ByVal hdc As Long) As Long
-
May 13th, 2002, 11:46 AM
#6
You call DeleteDC only when you have called CreateDC earlier.
You call ReleaseDC when you have called GetDC.
GetDC uses an existing DC from the pool in memory - maintained by Windows. CreateDC makes a brand new one - more overhead, therefore slower.
If you keep calling DeleteDC after GetDC, you will eventually crash the system. ReleaseDC after CreateDC has similar problems.

Assuming I understood what you meant.
-
May 13th, 2002, 03:40 PM
#7
Thread Starter
Lively Member
i didn't know that, i will have to change some of my code now.
But my question was
1) can i delete all created dc's with just one call, or do i have to use a seperate call for each dc.
2) where can i find a directx tutorial for dummies/beginners
(i have no idea what directx is, but everyone keeps recommending it to me.)
Often talked of, never seen,
Ever coming, never been,
Daily looked for, never here,
Still approaching, coming near,
Thousands for its visit wait,
But alas for their fate,
Tho' they expect me to appear,
They will never find me here.
What's this about?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|