Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorvald Natvig <slicer@users.sourceforge.net>2009-01-17 06:04:13 +0300
committerThorvald Natvig <slicer@users.sourceforge.net>2009-01-17 06:04:13 +0300
commit695074fbff91be5afb300639d3fef8539d74a88d (patch)
treea6ca7c9ce61483477856de4ea30e7876e8e618c8 /overlay_gl
parent1faac996b2f39b46684212dcf37bf12eda4efb0e (diff)
Multiapp overlay for *nix
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1444 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'overlay_gl')
-rw-r--r--overlay_gl/overlay.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/overlay_gl/overlay.c b/overlay_gl/overlay.c
index 396c9eef1..a8f16ca35 100644
--- a/overlay_gl/overlay.c
+++ b/overlay_gl/overlay.c
@@ -70,6 +70,7 @@ typedef struct _Context {
GLXDrawable draw;
GLXContext glctx;
GLuint textures[NUM_TEXTS];
+ unsigned int uiCounter[NUM_TEXTS];
} Context;
static Context *contexts = NULL;
@@ -162,9 +163,9 @@ static void newContext(Context * ctx) {
if (sm) {
sm->bHooked = true;
- for (i = 0; i < NUM_TEXTS; i++)
- sm->texts[i].bUpdated = true;
}
+ for (i = 0; i < NUM_TEXTS; i++)
+ ctx->uiCounter[i] = 0;
glGenTextures(NUM_TEXTS, ctx->textures);
@@ -251,7 +252,7 @@ static void drawContext(Context * ctx, Display * dpy, GLXDrawable draw) {
if (sm->texts[i].width == 0) {
y += iHeight / 4;
} else if (sm->texts[i].width > 0) {
- if (sm->texts[i].bUpdated) {
+ if (sm->texts[i].uiCounter != ctx->uiCounter[i]) {
ods("Updating %d %d texture", sm->texts[i].width, TEXT_HEIGHT);
glBindTexture(GL_TEXTURE_2D, ctx->textures[i]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -259,7 +260,7 @@ static void drawContext(Context * ctx, Display * dpy, GLXDrawable draw) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEXT_WIDTH, TEXT_HEIGHT, 0, GL_BGRA, GL_UNSIGNED_BYTE, sm->texts[i].texture);
- sm->texts[i].bUpdated = false;
+ ctx->uiCounter[i] = sm->texts[i].uiCounter;
}
texs[idx] = ctx->textures[i];
widths[idx] = sm->texts[i].width;