forked from bartvdbraak/blender
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! :)
This commit is contained in:
parent
9b40577d3a
commit
e81041bb98
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user