Hi,

When running the following code from within Gutsy, the results are
unpredictable: one time I see a gradient-filled triangle, other times
what seems to me is just random gfx memory is being displayed.

# Example 2-10 : Using glArrayElement() to Define Colors and Vertices

from pyglet.gl import *
from pyglet import window

win = window.Window()

def display():

    intertwined = [
        1.0, 0.2, 1.0, 100.0, 100.0, 0.0,
        1.0, 0.2, 0.2, 0.0, 200.0, 0.0,
        1.0, 1.0, 0.2, 100.0, 300.0, 0.0,
        0.2, 1.0, 0.2, 200.0, 300.0, 0.0,
        0.2, 1.0, 1.0, 300.0, 200.0, 0.0,
        0.2, 0.2, 1.0, 200.0, 100.0, 0.0]

    glEnableClientState (GL_COLOR_ARRAY)
    glEnableClientState (GL_VERTEX_ARRAY)

    glColorPointer (3, GL_FLOAT, 6 * sizeof(GLfloat), (GLfloat *
len(intertwined))(*intertwined))
    glVertexPointer (3, GL_FLOAT, 6 * sizeof(GLfloat), (GLfloat *
len(intertwined[3:]))(*intertwined[3:]))

    glBegin(GL_TRIANGLES)
    glArrayElement (2)
    glArrayElement (3)
    glArrayElement (5)
    glEnd()

def init():
    glClearColor (0.0, 0.0, 0.0, 0.0)
    glShadeModel (GL_FLAT)

while not win.has_exit:
    win.dispatch_events()
    win.clear()
    display()
    win.flip()

This code works as it should on XP (a gradient-filled triangle is
displayed). What could be wrong with my Kubunu setup? (I'm using an
ATI Technologies Inc R350 AH [Radeon 9800] graphics card, with the ati
(radeon) drivers).

Many thanks in advance!

Mathieu


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to