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

  • Home
  • SEARCH
  • 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 6981475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:09:44+00:00 2026-05-27T18:09:44+00:00

My code so far for the main function of the OpenGL program is basically

  • 0

My code so far for the main function of the OpenGL program is basically this:

int main(int argc, char **argv)
{
    glutInit(&argc, argv); // Initialize GLUT
    glutInitDisplayMode(GLUT_SINGLE); // Set up a basic display buffer (only single buffered for now)
    glutInitWindowSize(500, 500); // Set the width and height of the window
    glutInitWindowPosition(100, 100); // Set the position of the window (on your screen)
    glutCreateWindow("Statistical Mechanics Simulation"); // Set the title for the window
    glutDisplayFunc(display); // Tell GLUT to use the method "display" for rendering
    glutReshapeFunc(reshape); // Tell GLUT to use the method "reshape" for rendering
    glutIdleFunc(simulate);

    containers.push_back(Container(Coordinate(-50, -50, -50), Coordinate(100, 100, 50)));
    containers[0].addParticle(Particle(1, 5, Coordinate(30, 30, 0), Coordinate(5, 3, 0)));
    containers[0].addParticle(Particle(4, 2, Coordinate(-10, 20, 0), Coordinate(0, 0, 0)));
    containers[0].addParticle(Particle(5, 5, Coordinate(0, 0, 0), Coordinate(50, 0, 0)));

    glutMainLoop(); // Enter GLUT's main loop

    return 0;
}

What would be the best way to add menubars to the top of this OpenGL window, so that it can function more like a normal Windows application? What about adding other windows and panels?

  • 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-27T18:09:45+00:00Added an answer on May 27, 2026 at 6:09 pm

    OpenGL is merely a drawing API. Creating toplevel windows lies outside it’s scope. It is perfectly possible to implement a GUI toolkit with OpenGL. However I think you’re better off using a real toolkit like Qt or GTK.

    So far you’re using GLUT, which is not part of OpenGL! It’s a 3rd party library meant for small and simple example programs. You’re not forced to use it.

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

Sidebar

Related Questions

Here's my code so far: #include<iostream> #include<string> #include<fstream> using namespace std; int main() {
I have this code so far which perfectly but relies on there being a
This is what I have as far as code, it is in the first
I typed the following program: #include <stdio.h> int main(void) { int a = 3;
well i was creating a binary search tree using this code..as far as i
Once again, thank you for the great help so far. The source code: int
Ok. here's the operations i successfully code so far thank's to your help: Adittion:
How far is the code for best functionallity? I have two ComboBox, so the
So far i have got the code below which works lovely when trying an
So far I have managed to write some code that should print the source

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.