ok, im trying to set multisampling format inside the
program. i have looked at the modules for
wglpixelformatARB and got some code working, but only
to a point. now my code goes like this:
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GL.ARB.multisample import *
from OpenGL.WGL import *
from OpenGL.WGL.ARB.multisample import *
from OpenGL.WGL.ARB.pixel_format import *
<about 500 lines of code>
# some data brought in from the registry
# Fetch= ((size), fullscreen, bits, depth bits,
multisample samples)
Fetch=((800, 600), 1, 32, 32, 6)
pygame.init()
if Fetch[4]>0:
pygame.display.set_mode(Fetch[0],
OPENGL|DOUBLEBUF|FULLSCREEN, Fetch[2])
ppfd=[WGL_SAMPLES_ARB, Fetch[4],
WGL_SAMPLE_BUFFERS_ARB, GL_TRUE, WGL_DEPTH_BITS_ARB,
Fetch[3],
WGL_RED_BITS_ARB, 8, WGL_GREEN_BITS_ARB, 8,
WGL_BLUE_BITS_ARB, 8, WGL_ALPHA_BITS_ARB, 8, 0]
pfdclass=PIXELFORMATDESCRIPTOR()
pfdclass.__repr__()
for set in range(0, len(ppfd)-1, 2):
pfdclass.__setattr__(ppfd[set], ppfd[set+1])
PIXELFORMATDESCRIPTORPtr(ppfd)
hdc=wglGetCurrentDC()
ipf=ChoosePixelFormat(hdc, pfdclass.this)
DescribePixelFormat(hdc, ipf, 0, pfdclass.this)
SetPixelFormat(hdc, ipf, pfdclass.this)
pygame.quit()
pygame.init()
pygame.display.init()
if Fetch[1]:
pygame.display.set_mode(Fetch[0],
OPENGL|DOUBLEBUF|FULLSCREEN, Fetch[2])
else:
pygame.display.set_mode(Fetch[0],
OPENGL|DOUBLEBUF, Fetch[2])
<some more code>
and i get:
Traceback (most recent call last):
File "3dproject.py", line 523, in ?
SetPixelFormat(hdc, ipf, pfdclass.this)
WindowsError: [Errno 2000] The pixel format is
invalid.
any help, please??
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
|