mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-26 08:36:28 +00:00
[client] opengl: remove font management
This commit is contained in:
parent
cb9774bbd2
commit
0c35d9b057
@ -35,7 +35,6 @@
|
|||||||
#include "common/option.h"
|
#include "common/option.h"
|
||||||
#include "common/framebuffer.h"
|
#include "common/framebuffer.h"
|
||||||
#include "common/locking.h"
|
#include "common/locking.h"
|
||||||
#include "dynamic/fonts.h"
|
|
||||||
#include "ll.h"
|
#include "ll.h"
|
||||||
|
|
||||||
#define BUFFER_COUNT 2
|
#define BUFFER_COUNT 2
|
||||||
@ -116,9 +115,6 @@ struct Inst
|
|||||||
float uiScale;
|
float uiScale;
|
||||||
_Atomic(bool) frameUpdate;
|
_Atomic(bool) frameUpdate;
|
||||||
|
|
||||||
const LG_Font * font;
|
|
||||||
LG_FontObj fontObj;
|
|
||||||
|
|
||||||
LG_Lock formatLock;
|
LG_Lock formatLock;
|
||||||
LG_RendererFormat format;
|
LG_RendererFormat format;
|
||||||
GLuint intFormat;
|
GLuint intFormat;
|
||||||
@ -215,13 +211,6 @@ bool opengl_create(void ** opaque, const LG_RendererParams params,
|
|||||||
LG_LOCK_INIT(this->frameLock );
|
LG_LOCK_INIT(this->frameLock );
|
||||||
LG_LOCK_INIT(this->mouseLock );
|
LG_LOCK_INIT(this->mouseLock );
|
||||||
|
|
||||||
this->font = LG_Fonts[0];
|
|
||||||
if (!this->font->create(&this->fontObj, NULL, 14))
|
|
||||||
{
|
|
||||||
DEBUG_ERROR("Unable to create the font renderer");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
*needsOpenGL = true;
|
*needsOpenGL = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -272,9 +261,6 @@ void opengl_deinitialize(void * opaque)
|
|||||||
LG_LOCK_FREE(this->frameLock );
|
LG_LOCK_FREE(this->frameLock );
|
||||||
LG_LOCK_FREE(this->mouseLock );
|
LG_LOCK_FREE(this->mouseLock );
|
||||||
|
|
||||||
if (this->font && this->fontObj)
|
|
||||||
this->font->destroy(this->fontObj);
|
|
||||||
|
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,31 +393,6 @@ bool opengl_on_frame(void * opaque, const FrameBuffer * frame, int dmaFd,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bitmap_to_texture(LG_FontBitmap * bitmap, GLuint texture)
|
|
||||||
{
|
|
||||||
glBindTexture(GL_TEXTURE_2D , texture );
|
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT , 4 );
|
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, bitmap->width);
|
|
||||||
glTexImage2D(
|
|
||||||
GL_TEXTURE_2D,
|
|
||||||
0,
|
|
||||||
bitmap->bpp,
|
|
||||||
bitmap->width,
|
|
||||||
bitmap->height,
|
|
||||||
0,
|
|
||||||
GL_BGRA,
|
|
||||||
GL_UNSIGNED_BYTE,
|
|
||||||
bitmap->pixels
|
|
||||||
);
|
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool opengl_render_startup(void * opaque)
|
bool opengl_render_startup(void * opaque)
|
||||||
{
|
{
|
||||||
struct Inst * this = (struct Inst *)opaque;
|
struct Inst * this = (struct Inst *)opaque;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user