Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:17:59+00:00 2026-06-13T23:17:59+00:00

I’m trying to render the primitives in a normal fill mode, then as a

  • 0

I’m trying to render the primitives in a normal fill mode, then as a wire frame.

Render Code:

glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.9f, 0.9f, 0.9f, 1);
// reset matrix
glLoadIdentity();
// fill display list
glColor3c(150, 255, 255);
glCallList(lDList);
// wireframe display list
glColor3f(0, 0, 0);
glLineWidth(10);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINES);
glCallList(lDList);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

Display List Creation Code:

lDList = glGenLists(1);
glNewList(lDList, GL_COMPILE);
    glBegin(GL_QUADS);
        glVertex3i(-1, -1, 0);
        glVertex3i(1, -1, 0);
        glVertex3i(1, -1, -25);
        glVertex3i(-1, -1, -25);
    glEnd();
glEndList();

glColor3c Macro:

#define glColor3c(r, g, b) glColor3f(r / 255, g / 255, b / 255)

I’m expecting to get a cyan colored plane drawn with a black frame around it, but all that’s happening is that the second time I render the display list, it’s simply filling and drawing the entire thing, overwriting the pixels for the other primitive. I end up with the plane I want drawn, but its just black (the color I specified for the line “version”).

Any other information that might be useful is that I’m using SDL, on Windows 7 with
MSVC++ 2010. I do not make any calls to glEnable, so I have no weird settings enabled that would mess it up, or, perhaps solve the problem. My only OpenGL setup code sets up the projection and modelview matrix and then creates the display list.

Obviously my question is why is the second time I draw the display list is it filling the primitive instead of creating lines? How do I fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:17:59+00:00Added an answer on June 13, 2026 at 11:17 pm

    According to the docs for glPolygonMode in OpenGL 4.0, the second argument, mode, may only be one of GL_FILL, GL_POINT, or GL_LINE. In your example, you are passing GL_LINES, which is an entirely different enum value.

    I suspect that passing GL_LINES is handled by OpenGL such that it defaults back to GL_FILL if the received mode is not what it expects.

    Also note: the specification for glPolygonMode is the same back through OpenGL 2.1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to render a haml file in a javascript response like so:
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to select an H1 element which is the second-child in its group
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.