private void Init() { Debug.Log($"OpenGL version: {Gl.GetString(StringName.Version)}"); Debug.Log($"OpenGL shading version: {Gl.GetString(StringName.ShadingLanguageVersion)}"); Debug.Log($"OpenGL vendor: {Gl.GetString(StringName.Vendor)}"); Debug.Log($"OpenGL renderer: {Gl.GetString(StringName.Renderer)}"); Gl.ReadBuffer(ReadBufferMode.Back); Gl.Enable(EnableCap.Texture2d); Gl.Enable(EnableCap.DepthTest); Gl.DepthFunc(DepthFunction.Less); //Gl.Enable(EnableCap.Blend); //Gl.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); float[] quadVertices = { // position // tex coords 0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, -0.5f, -0.5f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f }; uint[] quadIndices = { 0, 1, 3, 1, 2, 3 }; float[] cubeVertices = { // position // tex coords -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, -0.5f, 0.5f, 0.5f, 1.0f, 0.0f }; uint[] cubeIndices = { 0, 1, 3, 3, 1, 2, 1, 5, 2, 2, 5, 6, 5, 4, 6, 6, 4, 7, 4, 0, 7, 7, 0, 3, 3, 2, 7, 7, 2, 6, 4, 5, 0, 0, 5, 1 }; Texture texture = TextureLoader.GetTexture("wall.jpg"); Models.Model cube = new Models.Model(cubeVertices, cubeIndices, texture); scene.AddModel(cube); }
public void AddModel(Models.Model model) { models.Add(model); }