The MASM Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 09, 2010, 02:01:53 am

Login with username, password and session length
Search:     Advanced search
117346 Posts in 14003 Topics by 1654 Members
Latest Member: road_hog
* Home Help Search Login Register
+  The MASM Forum
|-+  Project Support Forums
| |-+  OpenGL Forum (Moderator: hitchhikr)
| | |-+  DC dimensioning... help pls.
« previous next »
Pages: [1] Print
Author Topic: DC dimensioning... help pls.  (Read 957 times)
xandaz
Member
*****
Posts: 122


DC dimensioning... help pls.
« on: January 28, 2010, 10:50:35 pm »

   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
Member
*****
Posts: 122


Re: DC dimensioning... help pls.
« Reply #1 on: January 31, 2010, 03:02:22 pm »

   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: Male
Posts: 1012

Everything = Maths * Community2


Re: DC dimensioning... help pls.
« Reply #2 on: January 31, 2010, 04:55:00 pm »

I started here many moons ago it has masm samples also
http://nehe.gamedev.net/
Logged

We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv
xandaz
Member
*****
Posts: 122


Re: DC dimensioning... help pls.
« Reply #3 on: January 31, 2010, 11:16:32 pm »

   Thank you very much oex. I'm going to have a look.
Logged
xandaz
Member
*****
Posts: 122


Re: DC dimensioning... help pls.
« Reply #4 on: February 02, 2010, 07:07:43 pm »

   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: Male
Posts: 1474


MASM+OpenGL Fanatic


Re: DC dimensioning... help pls.
« Reply #5 on: February 04, 2010, 11:24:21 pm »

If Im not mistaken, here is the code

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
Member
*****
Posts: 122


Re: DC dimensioning... help pls.
« Reply #6 on: February 11, 2010, 07:22:41 pm »

   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] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!