roc/platform_win32.py
cecilkorik ab901dc58f Added platform specific architecture and cleaned up some of the platform
specific hacks in video.py
Added a config file (settings.cfg)
Added functionality for saving last used window position!
Added displaylists to models.py
Broke fonts (temporarily)
2011-10-23 01:42:40 -06:00

30 lines
641 B
Python

from ctypes import *
import pygame
def enable_vsync():
pass
def get_window_handle():
return pygame.display.get_wm_info()['window']
def get_window_rect(handle=None):
if handle is None:
handle = get_window_handle()
class RECT(Structure):
_fields_ = [('left', c_long),
('top', c_long),
('right', c_long),
('bottom', c_long)]
class POINT(Structure):
_fields_ = [('x', c_long),
('y', c_long)]
r = RECT()
p = POINT()
p.x = 0
p.y = 0
windll.user32.ClientToScreen(c_int(handle), byref(p))
return ( p.x, p.y, p.x, p.y )
return ( r.left, r.top, r.right, r.bottom )