push 0
push offset lpDD
push 0
call DirectDrawCreate

............????????
call SetCooperativeLevel
Posted on 2003-06-07 10:01:16 by sysnet
read SDK it say it very CLEARLY:

as i remember:

push DDSCL_EXCLUSIVE or DDSCL_FULLSCREEN
push

... <-- call setcooperative level (everyone calls DX metods elseway so use your favorite way.)
Posted on 2003-06-09 09:48:52 by ti_mo_n
Like this (from HE code):



;===============================================
; 1. Create a DirectDraw object.
;==============================================
call DirectDrawCreate, NULL, offset lpDD,NULL

; take action if it fails
.IF eax != DD_OK
call Fail, hwndmain, offset szDirectDrawCreateFail
jmp end_loop
.ENDIF

;========================================
; 2. Greedly set the coperative level so that it's in exclusive mode
;========================================
push (DDSCL_EXCLUSIVE OR DDSCL_FULLSCREEN OR DDSCL_ALLOWREBOOT)

mov eax,[hwndmain]
push eax

mov eax,[lpDD]
push eax ; DD Object

mov eax,[eax] ; vtable addr
call [eax+DDO_SetCooperativeLevel] ; call address for SetCooperativeLevel

;check for error
.IF eax != DD_OK
Call OutputDebugStringA, offset szSetCooperativeLevelFail
jmp end_loop
.ENDIF
Posted on 2003-06-09 11:31:15 by BogdanOntanu