- [...]
- TFieldType = record
- Texture : String;
- FType : Byte;
- FSpecial: Byte;
- end;
- TTexturemanager = class(TObject)
- Texture : Array of TglBitmap2D;
- TextureName: THashedStringList;
- [...]
- procedure BindTexture(pTextureName: String);
- end;
- TMap = object
- Playground : Array of Array of TFieldType;
- DefaultFieldtexture: String;
- [...]
- procedure Draw;
- [...]
- end;
- [...]
- procedure TTextureManager.BindTexture(pTextureName: String);
- begin
- If TextureName.IndexOf(pTextureName) > -1 then
- begin
- glEnable(GL_TEXTURE_2D);
- Texture[TextureName.indexOf(pTextureName)].Bind();
- end
- else
- glDisable(GL_TEXTURE_2D);
- end;
- [...]
- procedure TMap.Draw;
- [...]
- TextureManager.BindTexture(Playground[i, j].Texture);
- [...]
- end,