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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:58:46+00:00 2026-06-05T03:58:46+00:00

I am currently working on a video player for Windows using OpenGL. It works

  • 0

I am currently working on a video player for Windows using OpenGL. It works great, but one of my main goal is accuracy. That is, the image displayed should be exactly the image that was saved as a video.

Taking away everything video/file/input related, I have something along these lines as my glutDisplayFunc:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GLubyte frame[256*128*4]; // width*height*RGBA_size
for (int i=0;i<256*128;i++)
{
   frame[i*4] = 0x00; // R
   frame[i*4+1] = 0xAA; // G
   frame[i*4+2] = 0x00; // B
   frame[i*4+3] = 0x00; // A
}
glRasterPos2i(0,0);
glDrawPixels(256,128,GL_RGBA,GL_UNSIGNED_BYTE,frame);
glutSwapBuffers();

Combined with the code for glut..

glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(256, 128);
glutCreateWindow("...");
glutDisplayFunc(Render);
glPixelZoom(1,-1); // use top-to-bottom display
glEnable(GL_DEPTH_TEST);
glutMainLoop();

This is pretty straightforward and a huge simplification of the actual code. A frame with a RGB value #00AA00 is created and drawn with glDrawPixels.
As expected, the output is a green window. On first glance all seems good.

But when I use a tool such as http://instant-eyedropper.com/ to know the exact RGB value of a pixel, I realize that not all of the pixels are displayed as #00AA00.
Some pixels will have a value of #00A900. It will be the case of the first pixel in the top-left corner, as well as the 3rd, the 5th and so on on the same line and for every uneven line.

Now it can’t be a problem with Instant Eyedropper or with Windows since other programs output the right color for the same file.

Now my question:
Could it be possible that glDrawPixels somehow changes the pixels values, maybe as a way to go faster?
I would expect such a function to display exactly what we input in it, so I’m not quite sure what to think of it.

  • 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-05T03:58:47+00:00Added an answer on June 5, 2026 at 3:58 am

    OpenGL has enabled color dithering by default. So your GPU actually may perform color dithering for some reason. Try disabling it with glDisable(GL_DITHER);. Also be aware of colour management issues.

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

Sidebar

Related Questions

Currently I am working on video conferencing project.For this i m using pwnat for
I'm currently working on a flash project that has an intro video that plays
I'm working on a custom video player for iOS using AVFoundation. The idea is
Hi I am working on HTML5 Video Player, Currently i am experiencing a wierd
Currently I am working on video uploading app..my problem is that ,when I try
i am currently working on a web application that needs to accept video uploaded
I am currently playing a video in andriod from the url http://daily3gp.com/vids/747.3gp its working
Currently working with NSURLConnection. Found a great website showing important delegate methods coming with
Am currently working on an application that requires users to submit posts and comments
Im currently working on a site that you can upload large files.. on local

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.