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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-03-26 13:59:49 +0300
committerTon Roosendaal <ton@blender.org>2005-03-26 13:59:49 +0300
commite81041bb989a84cfe27b8b38fe5d130f1bd22c0a (patch)
tree1e770b973e107e96576bb95c93f2100ce8096e53 /intern
parent9b40577d3a3b6070855375bdeee0f3672f77f5e3 (diff)
TEMPORAL HACK!!!
Added the is_a_really_crappy_nvidia_card() call in BMF_DrawString(), this to solve a bug in NVidia 6800 drivers of MacOSX G5. It is #ifdeffed for OSX only, and queries for a NVidia 6800 card to activate the patch. The issue is that these drivers forgot to correctly implement viewport() offset for drawing bitmap fonts, causing text display in Blender to be invisible, except for the leftmost/bottom sub window. This hack will be removed when Apple releases a driver upgrade, which is unknown when to happen. Has to be decided still if this is worth for a release, or that we provide the hack as separate download. Thanks Randall Rickert for all testing, and Daniel for code review! :)
Diffstat (limited to 'intern')
-rw-r--r--intern/bmfont/intern/BMF_BitmapFont.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/intern/bmfont/intern/BMF_BitmapFont.cpp b/intern/bmfont/intern/BMF_BitmapFont.cpp
index 7aa7427430f..a2c59351c14 100644
--- a/intern/bmfont/intern/BMF_BitmapFont.cpp
+++ b/intern/bmfont/intern/BMF_BitmapFont.cpp
@@ -69,15 +69,37 @@ BMF_BitmapFont::~BMF_BitmapFont(void)
{
}
+#ifdef __APPLE__
+#include <stdio.h>
+static int is_a_really_crappy_nvidia_card(void) {
+ static int well_is_it= -1;
+
+ /* Do you understand the implication? Do you? */
+ if (well_is_it==-1) {
+ well_is_it= (strcmp(glGetString(GL_RENDERER), "NVIDIA GeForce 6800 GT OpenGL Engine") == 0);
+ }
+ return well_is_it;
+}
+#endif
void BMF_BitmapFont::DrawString(char* str)
{
GLint alignment;
unsigned char c;
+ GLint vp[4]; // hack stuff
+ GLubyte nullm = 0; // hack stuff
+
+#ifdef __APPLE__
+ if(is_a_really_crappy_nvidia_card()) {
+ glGetIntegerv(GL_VIEWPORT, vp); // hack stuff
+ glBitmap(1, 1, 0, 0, -vp[0], vp[1], &nullm);
+
+ }
+#endif
glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
+
while ( (c = (unsigned char) *str++) ) {
BMF_CharData & cd = m_fontData->chars[c];