Example #1
0
File: Font.cs Project: Dafvid/MCLib
 public Font(Texture texture)
 {
     Texture = texture;
     Colums = 16;
     Rows = 8;
     Spacing = 8;
     RowSpacing = 14;
 }
Example #2
0
 static void LoadTextures(List<string> failed)
 {
     try { TerrainTexture = new Texture("terrain.png"); }
     catch { TerrainTexture = new Texture(); failed.Add("terrain.png"); }
     try { ItemsTexture = new Texture("items.png"); }
     catch { ItemsTexture = new Texture(); failed.Add("items.png"); }
     try { FontTexture = new Texture("font.png"); }
     catch { FontTexture = new Texture(); failed.Add("font.png"); }
     Display.Texture = null;
 }
Example #3
0
        public Framebuffer(int width, int height)
            : this()
        {
            Width = width;
            Height = height;

            ColorTexture = new Texture(width, height);
            DepthTexture = new Texture(){ Width = width, Height = height };
            GL.TexImage2D(TextureTarget.Texture2D, 0,
                          PixelInternalFormat.DepthComponent32,
                          width, height, 0,
                          PixelFormat.DepthComponent,
                          PixelType.UnsignedInt, IntPtr.Zero);
            GL.BindTexture(TextureTarget.Texture2D, 0);

            GL.BindFramebuffer(FramebufferTarget.Framebuffer, ID);
            GL.FramebufferTexture2D(FramebufferTarget.Framebuffer,
                                    FramebufferAttachment.ColorAttachment0,
                                    TextureTarget.Texture2D, ColorTexture.ID, 0);
            GL.FramebufferTexture2D(FramebufferTarget.Framebuffer,
                                    FramebufferAttachment.DepthAttachment,
                                    TextureTarget.Texture2D, DepthTexture.ID, 0);
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
        }
Example #4
0
File: Draw.cs Project: Dafvid/MCLib
 public static void FilledRectangle(int x, int y, int width, int height, Texture tex, RectangleF texCoords)
 {
     Display.Texture = tex;
     FilledRectangle(x, y, width, height, texCoords);
 }
Example #5
0
File: Draw.cs Project: Dafvid/MCLib
 public static void FilledRectangle(int x, int y, int width, int height, Texture tex)
 {
     FilledRectangle(x, y, width, height, tex, new RectangleF(0.0f, 0.0f, 1.0f, 1.0f));
 }
Example #6
0
File: Draw.cs Project: Dafvid/MCLib
 public static void FilledRectangle(Rectangle rect, Texture tex, RectangleF texCoords)
 {
     FilledRectangle(rect.X, rect.Y, rect.Width, rect.Height, tex, texCoords);
 }
Example #7
0
File: Draw.cs Project: Dafvid/MCLib
 public static void FilledRectangle(Rectangle rect, Texture tex)
 {
     FilledRectangle(rect, tex, new RectangleF(0.0f, 0.0f, 1.0f, 1.0f));
 }