[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

GLUI library  in VS 2008.

Asked by loopfinity in Microsoft Visual C++.Net, OpenGL Graphics & Game Programming

Tags: openGL, GLUI, VS 2008

Hi there,

I have problem about glui library.
I follow the instructions whic are writen in these links   :  http://www.cs.purdue.edu/homes/cvanegas/cs334/jan16_18.htm  and   http://web.engr.oregonstate.edu/~mjb/cs553/gettingglut.html , but
 the program, which is attached, generates errors.

  1- can you recommend another way to get GLUI for VS 2008  or another User Interface library  ?
 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
/****************************************************************************
A simple GLUT program using the GLUI User Interface Library
This program sets up a checkbox and a spinner, both with live variables.
No callbacks are used.
-----------------------------------------------------------------------
9/9/98 Paul Rademacher (rademach@cs.unc.edu)
****************************************************************************/
#include
<string.h> 
#include
<GL/glut.h> 
#include
<GL/glui.h> 
/** These are the live variables passed into GLUI ***/
int
wireframe = 0; 
int
segments = 8; 
int
main_window; 
 
/***************************************** myGlutIdle() ***********/
void
myGlutIdle( void ) 
{
/* According to the GLUT specification, the current window is 
undefined during an idle callback. So we need to explicitly change
it if necessary */
if ( glutGetWindow() != main_window ) 
glutSetWindow(main_window);
glutPostRedisplay();
}
 
/**************************************** myGlutReshape() *************/
void
myGlutReshape( int x, int y ) 
{
float xy_aspect; 
xy_aspect = (
float)x / (float)y; 
glViewport( 0, 0, x, y );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -xy_aspect*.08, xy_aspect*.08, -.08, .08, .1, 15.0 );
glutPostRedisplay();
}
/***************************************** myGlutDisplay() *****************/
void
myGlutDisplay( void ) 
{
static float rotationX = 0.0, rotationY = 0.0; 
glClearColor( .9f, .9f, .9f, 1.0f );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
/*** Rotate the object ***/ 
rotationX += 3.3f;
rotationY += 4.7f;
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -1.0 );
glRotatef( rotationY, 0.0, 1.0, 0.0 );
glRotatef( rotationX, 1.0, 0.0, 0.0 );
/*** Now we render object, using the variables 'segments' and 
'wireframe'. These are _live_ variables, which are transparently
updated by GLUI ***/
if ( wireframe ) 
glutWireTorus( .2,.5,16,segments );
else 
glutSolidTorus( .2,.5,16,segments );
glutSwapBuffers();
}
 
/**************************************** main() ********************/
void
main(int argc, char* argv[]) 
{
/****************************************/ 
/* Initialize GLUT and create window */ 
/****************************************/ 
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutInitWindowPosition( 50, 50 );
glutInitWindowSize( 300, 300 );
main_window = glutCreateWindow( 
"GLUI Example 1" ); 
glutDisplayFunc( myGlutDisplay );
glutReshapeFunc( myGlutReshape );
/****************************************/ 
/* Set up OpenGL lights */ 
/****************************************/ 
GLfloat light0_ambient[] = {0.1f, 0.1f, 0.3f, 1.0f};
GLfloat light0_diffuse[] = {.6f, .6f, 1.0f, 1.0f};
GLfloat light0_position[] = {1.0f, 1.0f, 1.0f, 0.0f};
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
/****************************************/ 
/* Enable z-buferring */ 
/****************************************/ 
glEnable(GL_DEPTH_TEST);
 
/****************************************/ 
/* Here's the GLUI code */ 
/****************************************/ 
GLUI *glui = GLUI_Master.create_glui( 
"GLUI" ); 
glui->add_checkbox( 
"Wireframe", &wireframe ); 
GLUI_Spinner *segment_spinner =
glui->add_spinner( 
"Segments:", GLUI_SPINNER_INT, &segments ); 
segment_spinner->set_int_limits( 3, 60 );
glui->set_main_gfx_window( main_window );
/* We register the idle callback with GLUI, *not* with GLUT */ 
GLUI_Master.set_glutIdleFunc( myGlutIdle );
glutMainLoop();
}
[+][-]07/20/09 12:01 AM, ID: 24892893Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Microsoft Visual C++.Net, OpenGL Graphics & Game Programming
Tags: openGL, GLUI, VS 2008
Sign Up Now!
Solution Provided By: ikework
Participating Experts: 1
Solution Grade: A
 
[+][-]07/18/09 05:12 AM, ID: 24885731Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/18/09 07:14 AM, ID: 24886090Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/20/09 12:06 AM, ID: 24892909Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/20/09 08:53 AM, ID: 24896258Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/09 12:51 PM, ID: 25072663Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/11/09 06:37 AM, ID: 25309307Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625