mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
[Android] Make texture loading/deleting/drawing backend non-specific by making them happen in the backend instead of somewhere else. Just a clean up commit really.
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include <map>
|
||||
#include "CommonPaths.h"
|
||||
#include "Android/TextureLoader.h"
|
||||
#include "VideoBackendBase.h"
|
||||
|
||||
namespace ButtonManager
|
||||
{
|
||||
@ -60,14 +61,21 @@ namespace ButtonManager
|
||||
class Button
|
||||
{
|
||||
private:
|
||||
GLuint m_tex;
|
||||
int m_tex;
|
||||
ButtonType m_button;
|
||||
ButtonState m_state;
|
||||
float m_coords[8];
|
||||
public:
|
||||
Button(std::string filename, ButtonType button, float *coords)
|
||||
{
|
||||
m_tex = LoadPNG((std::string(DOLPHIN_DATA_DIR "/") + filename).c_str());
|
||||
u32 width, height;
|
||||
char *image;
|
||||
image = LoadPNG((std::string(DOLPHIN_DATA_DIR "/") + filename).c_str(), width, height);
|
||||
|
||||
m_tex = g_video_backend->Video_LoadTexture(image, width, height);
|
||||
|
||||
free(image);
|
||||
|
||||
m_button = button;
|
||||
memcpy(m_coords, coords, sizeof(float) * 8);
|
||||
m_state = BUTTON_RELEASED;
|
||||
@ -83,7 +91,7 @@ namespace ButtonManager
|
||||
GLuint GetTexture() { return m_tex; }
|
||||
float *GetCoords() { return m_coords; }
|
||||
|
||||
~Button() { if(m_tex) glDeleteTextures(1, &m_tex); }
|
||||
~Button() { g_video_backend->Video_DeleteTexture(m_tex); }
|
||||
};
|
||||
|
||||
struct sBind
|
||||
|
Reference in New Issue
Block a user