Jump to content
  • Advertisement
Sign in to follow this  
BlackRyder

problem with outline text

This topic is 4845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I encountered some problems with outline text. The problem is: before i display the outline text everything is rendered ok ( i am loading my model from 3ds file). after i display my outlined text the objects in the model are rendered backwords ( it looks like problem with glCullFace()) but i tried to force the correct CullFace before i rendered. i havent got a clue where is my problem i have pictires to deminstrate the problem. before displaying outline font: before.jpg after displaying outlined font: After.jpg 10x in advance Avishay

Share this post


Link to post
Share on other sites
Advertisement
Your right, this does look like a glCullFace problem. Can you post the render code for your outline text?

Cheers,
- llvllatrix

Share this post


Link to post
Share on other sites
well here it is

The first method builds the font and the display lists
and the second one render the text on the screen.


void Text::BuildOutlineFont(void)
{
HFONT font; // Windows Font ID

baseOutline = glGenLists(256); // Storage For 256 Characters

font = CreateFont( -12, // Height Of Font
0, // Width Of Font
0, // Angle Of Escapement
0, // Orientation Angle
FW_BOLD, // Font Weight
FALSE, // Italic
FALSE, // Underline
FALSE, // Strikeout
ANSI_CHARSET, // Character Set Identifier
OUT_TT_PRECIS, // Output Precision
CLIP_DEFAULT_PRECIS, // Clipping Precision
ANTIALIASED_QUALITY, // Output Quality
FF_DONTCARE|DEFAULT_PITCH, // Family And Pitch
"Comic Sans MS"); // Font Name

SelectObject(hDC, font); // Selects The Font We Created

wglUseFontOutlines( hDC, // Select The Current DC
0, // Starting Character
255, // Number Of Display Lists To Build
baseOutline, // Starting Display Lists
0.0f, // Deviation From The True Outlines
0.2f, // Font Thickness In The Z Direction
WGL_FONT_POLYGONS, // Use Polygons, Not Lines
gmf); // Address Of Buffer To Recieve Data
}

void Text::showOutLineText(Point3D &p,Color &color,string &text)
{
if(!(initMode & INIT_OUTLINE_FONT))
{
if(hDC==NULL)
{
throw Exception("Could Not Show Text hDC is NULL");
}
BuildOutlineFont();
initMode = initMode | INIT_OUTLINE_FONT;
}
glDisable(GL_TEXTURE_2D);
glColor3f(color[0],color[1],color[2]);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslatef(p.getX(),p.getY(),p.getZ());
glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits
glListBase(baseOutline); // Sets The Base Character to 0
glCallLists(text.length(), GL_UNSIGNED_BYTE, text.data()); // Draws The Display List Text
glPopAttrib(); // Pops The Display List Bits
glPopMatrix();
glEnable(GL_TEXTURE_2D);
}



Share this post


Link to post
Share on other sites
hmm...nothing too obvious. Can you query the state of the cull face property before and after the calls to these functions?

Cheers,
- llvllatrix

Share this post


Link to post
Share on other sites
i tried this insted i think it has the same effect ... but no luck

where menu.showMenu();
uses the methods above to show each option in the menu.


if(inMenu)
{
menu.showMenu();
}
else
{
glCullFace(GL_CW);
cam.Render();
world.draw();
}



and the CullFace is the same as in the init... agian no luck.. but i will try any way to trace a change in the cull face.

other ideas ?

10x

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
set glfrontface(GL_CCW) right after rendering your font - Crappy windows bug.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!