示例#1
0
        public uint LoadGLTextures()                                            // Load Bitmaps And Convert To Textures
        {
            OpenGL gl = openGLControl1.OpenGL;

            //  We'll hitch a ride off the scene graph here.
            particleTexture = new SharpGL.SceneGraph.Texture();
            particleTexture.Create(gl, "Particle.png");

            /*glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
             */
            texture[0] = particleTexture.TextureName;

            return(texture[0]);
        }
示例#2
0
        private void buttonLoad_Click(object sender, EventArgs e)
        {
            //  Show a file open dialog.
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                //  Destroy the existing texture.
                texture.Destroy(openGLControl1.OpenGL);

                //  Create a new texture.
                texture.Create(openGLControl1.OpenGL, openFileDialog1.FileName);

                //  Redraw.
                openGLControl1.Invalidate();
            }
        }
示例#3
0
        // Load Bitmaps And Convert To Textures
        public uint LoadGLTextures()
        {
            OpenGL gl = openGLControl1.OpenGL;

            //  We'll hitch a ride off the scene graph here.
            particleTexture = new SharpGL.SceneGraph.Texture();
            particleTexture.Create(gl, "Particle.png");
               /*glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
            */
            texture[0] = particleTexture.TextureName;

            return texture[0];
        }