Last active
March 30, 2016 05:12
-
-
Save ethanhs/646af61b61942646538cfc746d491f6a to your computer and use it in GitHub Desktop.
An example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
from pygame.locals import * | |
import glsvg | |
import sys | |
from OpenGL.GL import * | |
from OpenGL.GLU import * | |
def main(): | |
screen = pygame.display.set_mode((800,600),HWSURFACE|OPENGL|DOUBLEBUF) | |
while 1: | |
for event in pygame.event.get(): | |
if event.type==QUIT: | |
sys.exit() | |
glClearColor(1, 1, 1, 1) | |
glStencilMask(0xFF) | |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) | |
glMatrixMode(GL_PROJECTION) | |
glLoadIdentity() | |
glViewport(0, 0, 800, 600) | |
gluOrtho2D(0, 800, 600, 0) | |
glMatrixMode(GL_MODELVIEW) | |
glLoadIdentity() | |
for i in range(10): | |
thing = glsvg.SVGDoc("thing.svg") | |
thing.draw(20*i,0,scale=0.2) | |
pygame.display.flip() | |
if __name__=="__main__": | |
pygame.init() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment