OpenGL GUI anyone? Updated on 11/17/05

Started by
206 comments, last by Alpha_ProgDes 17 years, 10 months ago
The scenegraph demo uses glut so perhaps you don't have the glut32.dll and lib files? Try the opengl website to get the archive containing all the neccessaries; http://www.opengl.org/resources/libraries/glut.html
Advertisement
Yeah, that's what I was saying. I dont want to compile the scenegraph thing, I want to compile/get the actual librarires heh, any help appreciated.
Heh, yeah thats a problem, at the moment there is no separate project that compiles a lib for example, you'll just have to prise the cpp and h files from the scenegraph project, you'll either have to copy the misc tools files as well or go through the code and replace them with your own tools. Maybe a lib project would be a good addition to the archive? Not sure how easy that would be though!
I dont get it then. Do I just include the header files or is there a library I need.
where can I find the latest version of this project? looks very interesting...
Rather than make a lib, you could just include all the files (excluding main.cpp) into your project.


The latest version can be found on the first post of this topic
- relpats_eht
Cool. Thanks!

You guys seem like GUI experts. I have been trying to create a rounded rectangle button in OpenGL for quite a while now. The closest I came to was using anti-aliasing along with alpha test. However, the corners still look a bit pixelised. I am putting the code here. Maybe someone has a better idea...

glColor3f(0.0, 0.0, 0.5);

glPointSize(10.0);
glDisable(GL_BLEND);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5);

glBegin(GL_POINTS);

glVertex2f(50.0, 15.0);
glVertex2f(50.0, 25.0);

glVertex2f(250.0, 15.0);
glVertex2f(250.0, 25.0);


glEnd();
glDisable(GL_POINT_SMOOTH);
glDisable(GL_ALPHA_TEST);

glLineWidth(10.0);
glBegin(GL_LINES);

glVertex2f(50.0, 15.0);
glVertex2f(50.0, 25.0);
glVertex2f(250.0, 15.0);
glVertex2f(250.0, 25.0);

glVertex2f(50.0, 15.0);
glVertex2f(250.0, 15.0);

glVertex2f(50.0, 25.0);
glVertex2f(250.0, 25.0);
glEnd();

glRectf(50.0, 15.0, 250.0, 25.0);
glDisable(GL_ALPHA_TEST);

cheers,
xargy
I might just be misreading that code from lack of sleep, but did you forget to glEnable(GL_LINE_SMOOTH)?

I am not really a GUI expert, I just know the code to this thing quite well, and am currently in the process of overhauling it to parse something very similar to xhtml, so there would be a much lower learning curve and such.


*edit* Oh yes, and if you want smooth corners, you should not use points, in OpenGL, a point is a square, a point of size ten will just be a 10x10 square, so even with point smoothing, it will come out rough. You are better off using many short line segments, or using a triangle fan if the button is filled in.
- relpats_eht
Hi, well, anti-aliasing these lines is not useful as they are pretty straight..

The reason for using a point of size 10 with anti-aliasing was that I could run it through the alpha function and kinda receive a circular point... However, the output was not very good :(

This is very frustrating as I have spend the whole weekend on this problem trying varied approaches with little success :((
@xargon123

why do not simply use a quad with a texture (with alpha)?
so you can draw the button how you like in your graphics-app., and the rendered result should also good enough

This topic is closed to new replies.

Advertisement