示例#1
0
 public void Dispose()
 {
     if (Disposed)
     {
         return;
     }
     Disposed = true;
     NativeGL.nglDeleteFramebuffer(FBO);
     Opengl32.glDeleteTextures(1, new int[] { Texture });
 }
示例#2
0
 public static void LoadMatrix3x3(float[] m)
 {
     Opengl32.glMatrixMode(GLConsts.GL_MODELVIEW);
     float[] m4x4 = new float[]
     {
         m[0], m[1], 0, m[2],
         m[3], m[4], 0, m[5],
         0, 0, 1, 0,
         m[6], m[7], 0, m[8]
     };
     Opengl32.glLoadMatrixf(m4x4);
 }
示例#3
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);
        }
示例#4
0
 public void BindTexture()
 {
     Opengl32.glBindTexture(GLConsts.GL_TEXTURE_2D, Texture);
 }
示例#5
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void TexCoord(float s, float t)
 {
     Opengl32.glTexCoord2f(s, t);
 }
示例#6
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void Color(float red, float green, float blue, float alpha)
 {
     Opengl32.glColor4f(red, green, blue, alpha);
 }
示例#7
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void Color(System.Drawing.Color c)
 {
     Opengl32.glColor4f(c.R / 255f, c.G / 255f, c.B / 255f, c.A / 255f);
 }
示例#8
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void Color(float red, float green, float blue)
 {
     Opengl32.glColor3f(red, green, blue);
 }
示例#9
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void Vertex2(System.Drawing.PointF p)
 {
     Opengl32.glVertex2f(p.X, p.Y);
 }
示例#10
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void Vertex2(float x, float y)
 {
     Opengl32.glVertex2f(x, y);
 }
示例#11
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void End()
 {
     Opengl32.glEnd();
 }
示例#12
0
文件: GL.cs 项目: 2max968/Kritzelv2
 public static void Begin(PrimitiveType primitiveType)
 {
     Opengl32.glBegin((int)primitiveType);
 }