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)
43 lines
870 B
Python
Executable file
43 lines
870 B
Python
Executable file
import roc
|
|
import pygame
|
|
from OpenGL.GL import *
|
|
from py3dutil import vect, quat
|
|
import models
|
|
from platform_win32 import *
|
|
|
|
class test_universe(roc.base_universe):
|
|
def frame(self, events):
|
|
# pink triangle
|
|
glBegin(GL_TRIANGLE_STRIP)
|
|
glNormal3f(0.0, 0.0, 1.0)
|
|
glColor4f(1.0, 0.0, 0.5, 1.0)
|
|
glVertex3f( 20.0, 50.0, 1.0)
|
|
glVertex3f( 20.0, 600.0, 1.0)
|
|
glVertex3f( 400.0, 50.0, 1.0)
|
|
glEnd()
|
|
|
|
# yellow square
|
|
glBegin(GL_TRIANGLE_STRIP)
|
|
glNormal3f(0.0, 0.0, 1.0)
|
|
glColor4f(0.0, 0.2, 0.5, 1.0)
|
|
glVertex3f( 150.0, 20.0, -50.0)
|
|
glVertex3f( 150.0, 400.0, -50.0)
|
|
glVertex3f( 360.0, 20.0, -50.0)
|
|
glVertex3f( 360.0, 400.0, -50.0)
|
|
glEnd()
|
|
|
|
# texture test
|
|
mdl = models.mgr.create("m_test")
|
|
glPushMatrix()
|
|
glTranslate(100.0, 300.0, -5.0)
|
|
mdl.render()
|
|
glPopMatrix()
|
|
|
|
|
|
|
|
roc.init2d()
|
|
roc.set_universe(test_universe())
|
|
roc.main()
|
|
|
|
|
|
|