Skip to main content
GameDev.net gamedev.net
🔒 Locked

Directx troubles

Started by ggs Jan 15, 2000 at 2:31 AM 3 replies 650+ views
Original Post
ggs
ggs
Hi. i''m using Delphi5 and a translated version of DirectX6. I can successfully create a direct draw object, set the coop level and change the display mode. How ever when I when a add the code to dispose of the ddraw object, my program generates 3 errors when it finishes. Here is the code i''m using the release to object. var ddraw_ptr : IDirectDraw; ... // release the directdraw object if (ddraw_ptr <> nil) then ddraw_ptr._Release; // this line generates the errors Am I doing this right? If not how can i fix it? I''m not too sure if this is the right method. Thanks for any help
crent
crent
Hi ggs.
I allready use the DX7 Headers, but I get the same error:

DirectXResult := DDrawObjekt._Release;
if DirectXResult <> DD_OK then //here is the error , but its unknown

//I do the following to kind of "release" it
pointer(DDrawObjekt) := nil;
DDrawObjekt := nil;

I don''t know how to fix this, does anyone ?
Maybe an error in the translated headers.

-crent-
ggs
ggs
See my other topic. It has more info.
DDrawObjekt._Release returns a value defined BY delphi''s iunknown class. Thus the function ErrorString (its provided by the translated header) doesnt know what it is.
ggs
ggs
STUPID slow internet connection.
See my other topic. It has more info.
DDrawObjekt._Release returns a value defined BY delphi''s iunknown class. Thus the function ErrorString (its provided by the translated header) doesnt know what it is.
crent
crent
If you call ._Release on all the Surfaces you created with the DirectDrawOject then the call to DirectDrawOject._Release will work without an error.

Just tested that. But I thought Surfaces will be automatical released when the main DirectDrawOject is released.

-crent-

Topic Locked

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

Sign in to reply to this topic.