|
Pages: [1]
|
 |
|
Author
|
Topic: DC dimensioning... help pls. (Read 957 times)
|
|
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
|
|
|
|
|
Logged
|
|
|
|
|
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
|
|
|
|
|
Logged
|
|
|
|
oex
Futurist EDIT: In Training
Member
    
Gender: 
Posts: 1012
Everything = Maths * Community2
|
|
|
|
|
|
Logged
|
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.
|
|
|
|
|
Logged
|
|
|
|
|
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
|
|
|
|
|
Logged
|
|
|
|
Farabi
Accountant
Member
    
Gender: 
Posts: 1474
MASM+OpenGL Fanatic
|
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
|
|
|
|
|
Logged
|
19:33 And if a man from another country is living in your land with you, do not make life hard for him; (My website is under construction, dont know when it will be done)
|
|
|
|
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
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |