peng3d/window.py
def setup(self):
        """
        Sets up the OpenGL state.
        
        This method should be called once after the config has been created and before the main loop is started.
        You should not need to manually call this method, as it is automatically called by :py:meth:`run()`\ .
        
        Repeatedly calling this method has no effects.
        """
        if self._setup:
            return
        self._setup = True
        
        # Ensures that default values are supplied
        #self.cleanConfig()
        
        # Sets min/max window size, if specified
        if self.cfg["graphics.min_size"] is not None:
            self.set_minimum_size(*self.cfg["graphics.min_size"])
        if self.cfg["graphics.max_size"] is not None:
            self.set_maximum_size(*self.cfg["graphics.max_size"])
        
        # Sets up basic OpenGL state
        glClearColor(*self.cfg["graphics.clearColor"])
        
        glEnable(GL_DEPTH_TEST)
        glEnable(GL_BLEND)
        
        glShadeModel(GL_SMOOTH)
        
        if self.cfg["graphics.fogSettings"]["enable"]:
            self.setupFog()
        if self.cfg["graphics.lightSettings"]["enable"]:
            self.setupLight()
def setup(self):
        """
        Sets up the OpenGL state.
        
        This method should be called once after the config has been created and before the main loop is started.
        You should not need to manually call this method, as it is automatically called by :py:meth:`run()`\ .
        
        Repeatedly calling this method has no effects.
        """
        if self._setup:
            return
        self._setup = True
        
        # Ensures that default values are supplied
        #self.cleanConfig()
        
        # Sets min/max window size, if specified
        if self.cfg["graphics.min_size"] is not None:
            self.set_minimum_size(*self.cfg["graphics.min_size"])
        if self.cfg["graphics.max_size"] is not None:
            self.set_maximum_size(*self.cfg["graphics.max_size"])
        
        # Sets up basic OpenGL state
        glClearColor(*self.cfg["graphics.clearColor"])
        
        glEnable(GL_DEPTH_TEST)
        glEnable(GL_BLEND)
        
        glShadeModel(GL_SMOOTH)
        
        if self.cfg["graphics.fogSettings"]["enable"]:
            self.setupFog()
        if self.cfg["graphics.lightSettings"]["enable"]:
            self.setupLight()
Sets up the OpenGL state.
        
        This method should be called once after the config has been created and before the main loop is started.
        You should not need to manually call this method, as it is automatically called by :py:meth:`run()`\ .
        
        Repeatedly calling this method has no effects.