Ejemplo n.º 1
0
		public static ITexture LoadTexture( string name, string filename ) {
            Texture t = new Texture();
			// TODO: should be more involved in tracking/unloading textures
			t._id = Engine.Gl.GetTex( name );
			t._width = Constants.terrainPieceTextureWidth;
			t._height = Constants.terrainPieceTextureWidth;
			if ( t._id == 0 ) {
				t._id = Engine.TexFactory.LoadTexture( filename, name, 256, 256, CONST_TV_COLORKEY.TV_COLORKEY_BLACK, false, true );
			}
			t._name = name;
			return t;
		}
Ejemplo n.º 2
0
		public static ITexture CreateTexture( string name, int width, int height ) {
			Texture t = new Texture();
			t._name = name;
			t._render_surface = Engine.TV3DScene.CreateAlphaRenderSurface( width, height, false );
			t._width = width;
			t._height = height;

			// clear it
			t._render_surface.StartRender( true );
			int green = Engine.Gl.RGBA( 0, 1, 0, 1 );
			Engine.Screen2DImmediate.DRAW_FilledBox( 0, 0, width, height, green, green, green, green );
			t._render_surface.EndRender();
			t._id = t._render_surface.GetTexture();
			return t;
		}