Ejemplo n.º 1
0
        public static int LoadTexture(IntPtr data, int w, int h)
        {
            int tex = 0;

            Opengl32.glGenTextures(1, ref tex);
            Opengl32.glBindTexture(GLConsts.GL_TEXTURE_2D, tex);
            Opengl32.glTexImage2D(GLConsts.GL_TEXTURE_2D, 0, GLConsts.GL_RGBA, w, h,
                                  0, GLConsts.GL_RGBA, GLConsts.GL_UNSIGNED_BYTE, data);
            Opengl32.glTexParameteri(GLConsts.GL_TEXTURE_2D, GLConsts.GL_TEXTURE_MAG_FILTER, GLConsts.GL_LINEAR);
            Opengl32.glTexParameteri(GLConsts.GL_TEXTURE_2D, GLConsts.GL_TEXTURE_MIN_FILTER, GLConsts.GL_LINEAR);
            return(tex);
        }
Ejemplo n.º 2
0
 public void BindTexture()
 {
     Opengl32.glBindTexture(GLConsts.GL_TEXTURE_2D, Texture);
 }