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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:05:56+00:00 2026-05-13T08:05:56+00:00

Using GLfixed as my vertex number type the following code draws textures as expected:

  • 0

Using GLfixed as my vertex number type the following code draws textures as expected:

GLfixed vertices[] = 
{
    (int)point.x,           (int)point.y + size.height,
    (int)point.x + size.width,  (int)point.y + size.height,
    (int)point.x,           (int)point.y,
    (int)point.x + size.width,  (int)point.y
};

glVertexPointer(2, GL_FIXED, 0, vertices);

I read in the OpenGL docs that GLfixed is the least efficient type and that I should be using GLfloat instead. But when I switched my code over to floats nothing gets drawn.

GLfloat vertices[] = 
{
    point.x,        point.y + size.height,
    point.x + size.width,   point.y + size.height,
    point.x,        point.y,
    point.x + size.width,   point.y
};

glVertexPointer(2, GL_FLOAT, 0, vertices);

Is there another flag I need to set in the OpenGL state machine to get this to behave as expected?

  • 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-13T08:05:56+00:00Added an answer on May 13, 2026 at 8:05 am

    When I look at the documentation it looks like GL_FIXED is a fixed point 16:16 format. That means that the 16 upper bits of a GLfixed represents the integer part and the fraction is the lower 16 bits divided by 65536 (1 << 16).

    To convert this to a float simply divide the number by 65536:

    const float scale = 1.0f / 65536.0f;
    GLfloat vertices[] = 
    {
            point.x * scale               , (point.y + size.height) * scale,
            (point.x + size.width) * scale, (point.y + size.height) * scale,
            point.x * scale               , point.y * scale,
            (point.x + size.width) * scale, point.y * scale
    };
    
    glVertexPointer(2, GL_FLOAT, 0, vertices);
    

    If you’re vertex coordinates etc is also in GL_FIXEDformat you’ll have to scale them as well.

    Hope this helps.

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

Sidebar

Related Questions

Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
using Silverlight I am having trouble with the following code: CultureInfo culture = new
Using a populated Table Type as the source for a TSQL-Merge. I want to
using a binary search tree I need to add to a vector all int
Using EF Code First I have an model object that has multiple properties that
Using ASP.Net and VB.Net Code Image1.ImageUrl = c:\Blue hills.jpg The above code is not
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using Point Cloud Library on Ubuntu, I am trying to take multiple point clouds
using this code I can send one texture to the shader: devcon->PSSetShaderResources(0, 1, &pTexture);
Using ValueInjecter, I often find myself writing code like this: var foo1 = new

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.