News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DC dimensioning... help pls.

Started by xandaz, January 28, 2010, 10:50:35 PM

Previous topic - Next topic

xandaz

   Hi guys again. I'm studying opengl now and i'm having a bit of a problem because i want to create some buttons to change params of glPerspective and LookAt. I made a toolbar inside the main window but the DC covers all the client area and i can't see the controls. How do i change the size of the DC? I've the viewport funtions and SetWindowExtEx but nothing seems to work.
    See if you can look into giving me some help.
    Thanks guys
    Bests from xandaz

xandaz

   Hi guys again. I'm studying opengl now and i'm having a bit of a problem because i want to create some buttons to change params of glPerspective and LookAt. I made a toolbar inside the main window but the DC covers all the client area and i can't see the controls. How do i change the size of the DC? I've tried the viewport funtions and SetWindowExtEx/OrgEx but nothing seems to work.
    See if you can look into giving me some help.
    Thanks guys
    Bests from xandaz

oex

I started here many moons ago it has masm samples also
http://nehe.gamedev.net/
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

xandaz

   Thank you very much oex. I'm going to have a look.

xandaz

   Well, here i am again. It seems i must use available clipping commands to resize the DC, except that's what i've been doing and doesn't seem to work.
   I did something in these lines:
 
   inv. GetClientRect,hWnd,addr rect
   mov rect.bottom,30   ; exclude 0 to 30 this is where the buttons are
   invoke CreateRectRgnIndirect,addr rect
   mov hRng,eax
   invoke GetDCEx,hDC,hRng,DCX_EXCLUDERGN
   mov hDC,eax

   ;..... Set up Pixel format and openglDC

   inv. glInit
   now the device context covers the buttons.

   any ideas ? how can resize the DC

   thanks eveyone
   i'll be waiting for someone to answer

   best regs from xandaz

Farabi

If Im not mistaken, here is the code


_dmScreenSettings DEVMODE <>
.code
Change_Screen_Resolution proc w:dword, h:dword, bitsPerPixel:dword
invoke RtlZeroMemory, addr _dmScreenSettings, sizeof DEVMODE
mov _dmScreenSettings.dmSize, sizeof DEVMODE
mov _dmScreenSettings.dmPelsWidth, CMEM(w)
mov _dmScreenSettings.dmPelsHeight, CMEM(h)
mov _dmScreenSettings.dmBitsPerPel, CMEM(bitsPerPixel)
mov _dmScreenSettings.dmFields, DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT or DM_DISPLAYFREQUENCY
mov _dmScreenSettings.dmDisplayFrequency, 60
invoke ChangeDisplaySettings, addr _dmScreenSettings, CDS_FULLSCREEN
.if eax != DISP_CHANGE_SUCCESSFUL
xor eax, eax
.else
mov eax, TRUE
.endif
ret
Change_Screen_Resolution endp
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

xandaz

   Hey Farabi. Thanks. That's not what i was looking for tho. Anyway i put the wrong operator when i created the main window (WS_TILED*WS_CLIPCHILDREN instead of WS_TILED+WS_CLIP...) so the DC covered the buttons. It's working now but yet i still don't know why GetDCEX with DCX_EXCLUDERGN didn't work.
   Thanks anyway. Help is always appreciatted.
   Bests for X