More correct, still doesn't work.

This commit is contained in:
Paul Chote
2010-08-14 22:23:22 +12:00
parent 8118a17e3c
commit 0a2d39f15b
4 changed files with 17 additions and 19 deletions

View File

@@ -283,6 +283,7 @@ namespace OpenRA.GlRenderer
public IVertexBuffer<Vertex> CreateVertexBuffer(int size) { return new VertexBuffer<Vertex>(this, size); }
public IIndexBuffer CreateIndexBuffer(int size) { return new IndexBuffer(this, size); }
public ITexture CreateTexture() { return new Texture(this); }
public ITexture CreateTexture(Bitmap bitmap) { return new Texture(this, bitmap); }
public IShader CreateShader(Stream stream) { return new Shader(this, stream); }
}

View File

@@ -20,7 +20,13 @@ namespace OpenRA.GlRenderer
public class Texture : ITexture
{
internal int texture;
public Texture(GraphicsDevice dev)
{
Gl.glGenTextures(1, out texture);
GraphicsDevice.CheckGlError();
}
public Texture(GraphicsDevice dev, Bitmap bitmap)
{
Gl.glGenTextures(1, out texture);