Ejemplo n.º 1
0
        public void InitEngine(OpenGL gl)
        {
            try
            {
                DebugTools.LogToConsole("Prepareing GL");
                //setup open gl and activate modes
                gl.TexParameter(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_S, OpenGL.GL_REPEAT);
                gl.TexParameter(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_T, OpenGL.GL_REPEAT);
                gl.TexParameter(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MAG_FILTER, OpenGL.GL_NEAREST);
                gl.TexParameter(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MIN_FILTER, OpenGL.GL_NEAREST);
                gl.Enable(OpenGL.GL_BLEND);
                gl.Enable(OpenGL.GL_TEXTURE_2D);
                gl.Enable(OpenGL.GL_DEPTH_TEST);
                //fffgl.Enable(OpenGL.GL_LIGHTING);
                gl.BlendFunc(OpenGL.GL_SRC_ALPHA, OpenGL.GL_ONE_MINUS_SRC_ALPHA);
                gl.ShadeModel(OpenGL.GL_SMOOTH);
                //Darw the first frame with a load test
                Draw(gl);

                DebugTools.LogToConsole("Loading Resources");
                //Loading the resources and bind to gl
                resourceManager = new ResourceManager();
                DebugTools.LogToConsole("Applying Textures");
                resourceManager.InitTextures(gl);
                DebugTools.LogToConsole("Loading Level");
                //Loading level
                //_level = new MasterMindGame.MasterMind();
                //_level.Build(this);
                _level = new MasterMindGame.MasterMind();
                _level.Build(this);
                GameObjects.Sort(
                    delegate(GameObject p1, GameObject p2)
                {
                    return(p1.Z_Index.CompareTo(p2.Z_Index));
                }
                    );
                //Startup is complete
                StartupComplete = true;
            }
            catch (Exception error)
            {
                DebugTools.LogError(error);
            }
        }
Ejemplo n.º 2
0
 public TomatoMainEngine(SharpGLForm form)
 {
     _form = form;
     DebugTools = new DebugTools(this);
     DebugTools.LogToConsole("Start Up");
 }
Ejemplo n.º 3
0
 public TomatoMainEngine(SharpGLForm form)
 {
     _form      = form;
     DebugTools = new DebugTools(this);
     DebugTools.LogToConsole("Start Up");
 }