Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opengl polygon at a certain frame rate
QtWS25 Last Chance

Opengl polygon at a certain frame rate

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 565 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    apreddy
    wrote on last edited by
    #1

    Hello There,

    I have written a simple opengl polygon function to display a polygon. as a next step to this i would like to display this static polygon at a certain frame rate. what would be the best approach for doing this. I would like to avoid using GLUT.
    @
    void GLWidget::paintGL(){
    glClear(GL_COLOR_BUFFER_BIT);
    glBegin(GL_POLYGON);
    glColor3f(0, 0, 0);
    glVertex2d(0,0);
    glColor3f(1, 1, 1);
    glVertex2d(3840,0);
    glColor3f(1, 1, 1);
    glVertex2d(3840,2160);
    glColor3f(0, 0, 0);
    glVertex2d(0,2160);
    glEnd();
    }@

    Here is my resize function

    @void GLWidget::resizeGL(int w, int h){
    HDC hdc = GetDC (NULL);
    int width = GetDeviceCaps (hdc, HORZRES);
    int height = GetDeviceCaps (hdc, VERTRES);
    ReleaseDC (NULL, hdc);

    glViewport(0,0,width,height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0.0f, 3840, 2160, 0.0f, -1.0f, 1.0f);
    
        glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    

    }@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved