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 6149755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:30:24+00:00 2026-05-23T19:30:24+00:00

I had this problem a long time ago and recently I got some clues

  • 0

I had this problem a long time ago and recently I got some clues on it but still not very clear.

I basically render a texture to a existing figure using depth-testing. The function works fine under nvdia graphics card, but not on intel graphics card (sometimes the picture not stable, some times just junks).

First I think this might be the card problem. Recently I found if I changed the display mode in choosepixelformat,it works also great on the intel card.

I tried also the mode chosen by the getpixelformat function, and guess it might be due to the depth precision problem, I tried some techniques recommended on opengl FAQ, but no success. I tried several RGBA display modes, and they are (only modes with double buffers are used and they are 2,4,6,9,10, 13,14):

      Draw Pixel Color             Depth Stencil Double Stereo Aux    
Index To   Type  Bits  R  G  B  A  Bits  Bits    Buffer Buffer Buffers
======================================================================

2     win  rgba  32    8  8  8  8  .     .       yes    .      .      
4     win  rgba  32    8  8  8  8  16    .       yes    .      .      
6     win  rgba  32    8  8  8  8  24    8       yes    .      .      
9     win  rgba  32    8  8  8  .  32    8       yes    .      .      
10    win  rgba  32    8  8  8  .  16    8       yes    .      .      
13    win  rgba  32    8  8  8  8  32    8       yes    .      .      
14    win  rgba  32    8  8  8  8  16    8       yes    .      .      

The modes which display correctly are 2, 9, 10, 13, 14. The failed ones are 4, 6. The windows chooses mode 4.

Anyone can give me some hints?

Thanks for the comments and here I add the bad rendering & the good rendering picture on the same machine. One is mode 4 and one is mode 10:

sorry! The system does not allow me to paste the image here

The bad one pasted here is just one of them, some may show other strange pictures.

Partial code:
OpenGL initialization

    m_pDC = new CClientDC(this);
//m_pDC = new CPaintDC(this);
m_hDC=m_pDC->GetSafeHdc();

static PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
 PFD_DRAW_TO_WINDOW | // support window
 PFD_SUPPORT_OPENGL | // support OpenGL
 PFD_DOUBLEBUFFER, // double buffered
 PFD_TYPE_RGBA, // RGBA type
 24, // 24-bit color depth
 0, 0, 0, 0, 0, 0, // color bits ignored
 0, // no alpha buffer
 0, // shift bit ignored
 0, // no accumulation buffer
 0, 0, 0, 0, // accum bits ignored
 16, // 16-bit z-buffer
 0, // no stencil buffer
 0, // no auxiliary buffer
 PFD_MAIN_PLANE, // main layer
 0, // reserved
 0, 0, 0 // layer masks ignored
 };
 int m_PixelFormat;
 //we may need to rewrite this function since it does not need the alpha bits
 m_PixelFormat = ::ChoosePixelFormat(m_hDC, &pfd);

 ::SetPixelFormat(m_hDC, m_PixelFormat, &pfd);
//::SetPixelFormat(m_hDC, 10, &pfd);
//
m_hRC = ::wglCreateContext( m_hDC );
wglMakeCurrent( m_hDC, m_hRC ); 

wglMakeCurrent(NULL,NULL);

return TRUE;

Rendering is in the WM_PAINT message function:
::glEnable( GL_DEPTH_TEST );
::glPolygonMode( GL_FRONT_AND_BACK,GL_FILL);

::glViewport( 0, 0, rcClient.Width() , rcClient.Height() );

     ....
    draw(...);

The draw function will be like this:

gluPerspective(90, width/height, 0.001, height/1);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

gluLookAt(cx,cy,cz,cx,cy,0,0,1,0);

then draw the map here……
glDisable(GL_TEXTURE_2D);

glDisable(GL_DEPTH_TEST);

then draw the lines & other objects here…

all objects are all in 2D vertex format, no any 3D depth values.

  • 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-05-23T19:30:25+00:00Added an answer on May 23, 2026 at 7:30 pm

    I forgot to put back my solutions on this question. It turns out that it is a problem of the intel card hardware acceleration. I tried to turn off the hardware acceleration by choosing a software rendering, the problem disappeared.

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

Sidebar

Related Questions

This is a problem I've had on my mind for a long time. Being
The responses I've got to this question have solved the problem I had in
I've had this long term issue in not quite understanding how to implement a
Coming from C/C++ a long time ago I still have a habit of ensuring
I have used Eclipse for a very long time. It has its problems, but
There're some problem. I have a report which is executed long time. When the
I've had this problem many times before, and I've never had a solution I
I've had this problem a couple of times. Let's say I want to display
In the spirit of being helpful, this is a problem I had and solved,
This might seem obvious but I've had this error when trying to use LINQ

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.