OpenGL Circular "pie" immediate-mode GUI for games & tools

Recommended Posts

I've started building a small library, that can render pie menu GUI in legacy opengl, planning to add some traditional elements of course.

It's interface is similar to something you'd see in IMGUI. It's written in C.

Early version of the library

I'd really love to hear anyone's thoughts on this, any suggestions on what features you'd want to see in a library like this? 

Thanks in advance!

Share this post


Link to post
Share on other sites
14 minutes ago, michaeldodis said:

I'd really love to hear anyone's thoughts on this, any suggestions on what features you'd want to see in a library like this? 

Tool tips, hierarchical menus, curved text? 

Personally, I'd want to see the rendering (GL code) separated out of the library and into a samples/examples folder. Any GUI lib that doesn't do this is unusable (sorry for the harsh words! :o). See Dear ImGui,, librocket, etc for one's that do. 

Another thing you could do is write a pie gizmo as an add on for Dear ImGui,. That would save you from having to write everything else. A kind of circular add on pack :) here's an example of someone else doing this: https://github.com/CedricGuillemet/ImGuizmo

Share this post


Link to post
Share on other sites
10 hours ago, Hodgman said:

Tool tips, hierarchical menus, curved text? 

Personally, I'd want to see the rendering (GL code) separated out of the library and into a samples/examples folder. Any GUI lib that doesn't do this is unusable (sorry for the harsh words! :o). See Dear ImGui,, librocket, etc for one's that do. 

Another thing you could do is write a pie gizmo as an add on for Dear ImGui,. That would save you from having to write everything else. A kind of circular add on pack  here's an example of someone else doing this: https://github.com/CedricGuillemet/ImGuizmo

Oh, so having the user provide the graphics back-end? I haven't really looked at most of the source code in IMGUI, but I did have a look at This library, which is practically the same, but header-only and in ANSI C. 

I'll try to adjust it so the GUI logic can be written separately from the rendering code.

Thanks for the suggestion man! 

Edited by michaeldodis

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Forum Statistics

    • Total Topics
      628701
    • Total Posts
      2984287
  • Similar Content

    • By ORmorni
      I am working on a multiplayer Android game using OpenGL ES in Android Studio. The game is planned as a 2d top-down shooter, in which the players survive while defeating waves of enemies. Coordination between the players is required to defeat the enemies, due to the enemy design - for an example, some enemies can be seen only by the player they target, and must be killed by others.
      I have already implemented basic menus and mechanics for the game, and am currently searching for a 2d artist to create graphics for the game.
      I can be contacted at ron_solan@walla.com
    • By mister345
      Hi, I'm building a game engine using DirectX11 in c++.
      I need a basic physics engine to handle collisions and motion, and no time to write my own.
      What is the easiest solution for this? Bullet and PhysX both seem too complicated and would still require writing my own wrapper classes, it seems. 
      I found this thing called PAL - physics abstraction layer that can support bullet, physx, etc, but it's so old and no info on how to download or install it.
      The simpler the better. Please let me know, thanks!
    • By alex1997
      I'm looking to render multiple objects (rectangles) with different shaders. So far I've managed to render one rectangle made out of 2 triangles and apply shader to it, but when it comes to render another I get stucked. Searched for documentations or stuffs that could help me, but everything shows how to render only 1 object. Any tips or help is highly appreciated, thanks!
      Here's my code for rendering one object with shader!
       
      #define GLEW_STATIC #include <stdio.h> #include <GL/glew.h> #include <GLFW/glfw3.h> #include "window.h" #define GLSL(src) "#version 330 core\n" #src // #define ASSERT(expression, msg) if(expression) {fprintf(stderr, "Error on line %d: %s\n", __LINE__, msg);return -1;} int main() { // Init GLFW if (glfwInit() != GL_TRUE) { std::cerr << "Failed to initialize GLFW\n" << std::endl; exit(EXIT_FAILURE); } // Create a rendering window with OpenGL 3.2 context glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // assing window pointer GLFWwindow *window = glfwCreateWindow(800, 600, "OpenGL", NULL, NULL); glfwMakeContextCurrent(window); // Init GLEW glewExperimental = GL_TRUE; if (glewInit() != GLEW_OK) { std::cerr << "Failed to initialize GLEW\n" << std::endl; exit(EXIT_FAILURE); } // ----------------------------- RESOURCES ----------------------------- // // create gl data const GLfloat positions[8] = { -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, }; const GLuint elements[6] = { 0, 1, 2, 2, 3, 0 }; // Create Vertex Array Object GLuint vao; glGenVertexArrays(1, &vao); glBindVertexArray(vao); // Create a Vertex Buffer Object and copy the vertex data to it GLuint vbo; glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(positions), positions, GL_STATIC_DRAW); // Specify the layout of the vertex data glEnableVertexAttribArray(0); // layout(location = 0) glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, 0); // Create a Elements Buffer Object and copy the elements data to it GLuint ebo; glGenBuffers(1, &ebo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(elements), elements, GL_STATIC_DRAW); // Create and compile the vertex shader const GLchar *vertexSource = GLSL( layout(location = 0) in vec2 position; void main() { gl_Position = vec4(position, 0.0, 1.0); } ); GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vertexShader, 1, &vertexSource, NULL); glCompileShader(vertexShader); // Create and compile the fragment shader const char* fragmentSource = GLSL( out vec4 gl_FragColor; uniform vec2 u_resolution; void main() { vec2 pos = gl_FragCoord.xy / u_resolution; gl_FragColor = vec4(1.0); } ); GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fragmentShader, 1, &fragmentSource, NULL); glCompileShader(fragmentShader); // Link the vertex and fragment shader into a shader program GLuint shaderProgram = glCreateProgram(); glAttachShader(shaderProgram, vertexShader); glAttachShader(shaderProgram, fragmentShader); glLinkProgram(shaderProgram); glUseProgram(shaderProgram); // get uniform's id by name and set value GLint uRes = glGetUniformLocation(shaderProgram, "u_Resolution"); glUniform2f(uRes, 800.0f, 600.0f); // ---------------------------- RENDERING ------------------------------ // while(!glfwWindowShouldClose(window)) { // Clear the screen to black glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.0f, 0.5f, 1.0f, 1.0f); // Draw a rectangle made of 2 triangles -> 6 vertices glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL); // Swap buffers and poll window events glfwSwapBuffers(window); glfwPollEvents(); } // ---------------------------- CLEARING ------------------------------ // // Delete allocated resources glDeleteProgram(shaderProgram); glDeleteShader(fragmentShader); glDeleteShader(vertexShader); glDeleteBuffers(1, &vbo); glDeleteVertexArrays(1, &vao); return 0; }  
    • By DaddyEso
      Hello there, I am a former player in the small, but dedicated community for the long dead MMO game Wind Slayer.

      I have been looking to play the game for 7 years, and just assumed that someone else would come along and create a private server. Since I've been waiting about 4 years since the last time I heard any discussion about a private server, I figured I'd have to do this myself.

      I have all of the game's files, I am looking for a team who would be willing to develop a private server. Already checked on the status of the game's IP and the developer (Hamelin) is a dead company, also; none of the former publishers (Outspark, and Ignited) exist either. So copyright concerns won't be an issue since the game isn't owned by any companies as of today.

      Link to the game's files for anyone who's interested: http://download.cnet.com/Windslayer/3000-7540_4-10857324.html

       

  • Popular Now