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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:51:11+00:00 2026-05-20T00:51:11+00:00

I had OpenGL project for finding a convex hull written in Windows. Now i’m

  • 0

I had OpenGL project for finding a convex hull written in Windows.

Now i’m using Ubuntu 10.10 and i tried to port the code (It’s C++ code) and run it.

I saw that, it should be compiled this way :

g++ convex.cpp -lm -lglut -lGLU -o convex_hull_project

It compiles the file, but when i run the file ./convex_hull_project it starts the program, shows the title but there is nothing – it only docks for the bottom task line and when i click it – nothing shows. There is no window with the program.
Any idea ?
Here’s the code that uses OpenGL stuff :

int main(int argc, char* argv[]) {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH); // color, buffer
    glutInitWindowPosition(100,100);
    glutInitWindowSize(window_size_width,window_size_height);
    glutCreateWindow("Convex hull");
    glutDisplayFunc(renderScene);
    glutMouseFunc(mouse);
    glutMainLoop();
    return 0;
}


void renderScene(void) {

    // clear framebuffer
    glClearColor(0.f,0.f,0.f,0.f);
    glClear(GL_COLOR_BUFFER_BIT);

    // set-up matrix
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0,window_size_width,window_size_height,0,-1,1);

    glViewport(0,0,window_size_width,window_size_height);
        //drawing ... 
    }

And includes are :

#include<GL/glut.h>
#include<GL/glu.h>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<math.h>
  • 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-20T00:51:12+00:00Added an answer on May 20, 2026 at 12:51 am

    You have to call glutCreateWindow before you set windows’s properties. Your code, fixed (I’ve replaced width and height constants with 300 just to get it to compile and commented out mouse handler registration):

    #include <cstdio>
    #include <vector>
    #include <algorithm>
    #include <cmath>
    
    #include <GL/glut.h>
    #include <GL/glu.h>
    
    void renderScene(void) {
    
        // clear framebuffer
        glClearColor (0.f,0.f,0.f,0.f);
        glClear (GL_COLOR_BUFFER_BIT);
    
        // set-up matrix
        glMatrixMode (GL_PROJECTION);
        glLoadIdentity ();
        glOrtho (0, 300, 300, 0,-1,1);
    
        glViewport (0,0,300, 300);
        //drawing ... 
    }
    
    int main(int argc, char* argv[])
    {
        glutInit (&argc, argv);
        glutInitDisplayMode (GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH); // color, buffer
        glutCreateWindow ("Convex hull");
        glutInitWindowPosition (100, 100);
        glutInitWindowSize (300, 300);
        glutDisplayFunc (renderScene);
        //glutMouseFunc (mouse);
        glutMainLoop ();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ubuntu and tried using synaptic to install everything that had the word
As I had many problems setting Visual Studio 2008 for using OpenGL I will
Due to performance issues, I have had to transfer my android opengl code from
okay i'm making a game using c++ (for the engine) and openGL, now i've
Do anyone tried GLPaint sample application with OpenGl ES 2.0 ? I had a
I'm starting a C++ project using OpenGL and Qt for the UI in eclipse.
I have an errors during compilation of OpenGL SFML C++ project in Eclipse (using
I had installed OpenGL and freeglut in Ubuntu 10.04 and it worked fine in
I've already written a game engine in java using eclipse and opengl es, I
I'm interested in learning to use OpenGL and I had the idea of writing

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.