Removal of my terrible idea.

This commit is contained in:
Ryan Houdek
2013-09-02 05:31:48 -05:00
parent e7157e7c52
commit 2897619ddb
8 changed files with 10 additions and 90 deletions

View File

@ -123,36 +123,6 @@ void SWRenderer::DrawDebugText()
SWRenderer::RenderText(debugtext_buffer, 20, 20, 0xFFFFFF00);
}
// XXX: We should /really/ be outputting textures to the texture image instead of this way.
void SWRenderer::DrawButton(int texID, float *coords)
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
static const GLfloat texverts[4][2] = {
{0, 1},
{0, 0},
{1, 0},
{1, 1}
};
glBindTexture(GL_TEXTURE_2D, texID);
glVertexAttribPointer(attr_pos, 2, GL_FLOAT, GL_FALSE, 0, coords);
glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, texverts);
glEnableVertexAttribArray(attr_pos);
glEnableVertexAttribArray(attr_tex);
glActiveTexture(GL_TEXTURE0);
glUniform1i(uni_tex, 0);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glDisableVertexAttribArray(attr_pos);
glDisableVertexAttribArray(attr_tex);
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_BLEND);
}
void SWRenderer::DrawTexture(u8 *texture, int width, int height)
{
GLsizei glWidth = (GLsizei)GLInterface->GetBackBufferWidth();

View File

@ -16,7 +16,6 @@ namespace SWRenderer
void RenderText(const char* pstr, int left, int top, u32 color);
void DrawDebugText();
void DrawButton(int texId, float *coords);
void DrawTexture(u8 *texture, int width, int height);
void SwapBuffer();

View File

@ -242,32 +242,6 @@ bool VideoSoftware::Video_Screenshot(const char *_szFilename)
return false;
}
int VideoSoftware::Video_LoadTexture(char *image, u32 width, u32 height)
{
GLuint Texture = 0;
glGenTextures(1, &Texture);
glBindTexture(GL_TEXTURE_2D, Texture);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, image);
return (int) Texture;
}
void VideoSoftware::Video_DeleteTexture(int texID)
{
if (texID == -1) return;
glDeleteTextures(1, (GLuint*)&texID);
}
void VideoSoftware::Video_DrawTexture(int texID, float *coords)
{
if (texID == -1) return;
SWRenderer::DrawButton(texID, coords);
}
// -------------------------------
// Enter and exit the video loop
// -------------------------------