VoxelEngine/Lights/LightingManager.py
2017-08-27 12:51:26 +02:00

38 lines
No EOL
1.1 KiB
Python

from OpenGL.GL import *
import numpy as np
from OpenGL.GL.ARB.vertex_array_object import glDeleteVertexArrays
from OpenGL.GL.framebufferobjects import glBindRenderbuffer
from OpenGL.GLUT import *
import OpenGL.GLUT.freeglut
from OpenGL.GLU import *
from OpenGL.GL import *
from ctypes import sizeof, c_float, c_void_p, c_uint
from MatrixStuff.Transformations import *
class LightingManager:
def __init__(self):
self.Lights = []
self.renderSteps = []
def addLight(self,l):
self.Lights.append(l)
def removeLight(self,l):
self.Lights.remove(l)
class __Renderstep:
def __init__(self,program, vai):
self.program = program
self.vai = vai
def __eq__(self, other):
if type(other) is type(self):
return self.program == other.program and self.vai == self.vai
else:
return False
def addRenderStep(self,program,vai):
r = self.__Renderstep(program,vai)
self.renderSteps.append(r)
def removeRenderStep(self,program,vai):
r = self.__Renderstep(program, vai)
self.renderSteps.remove(r)