Avatar of jsbsudha
jsbsudhaFlag for Germany

asked on 

GLUT_Window_width

I am using Glut and glui in may c++ application.......I want to get the width of the GLUI window and set the viewport so I have used......

glutGet(GLUT_WINDOW_WIDTH);#

but It is not taking the actual window size bcos.....I have defined the following statement before the abiove one

glutInitWindowSize(INIT_WINDOW_SIZE, INIT_WINDOW_SIZE);
glutSetWindow(mainwindow);
INIT_WINDOW_SIZE  is a user defined  varaiable which holds some value like 1500...
so GLUT_WINDOW_WIDTH is giving the value of the varaiable INIT_WINDOW_SIZE  and not the real one......


so my problem how to define real window width and height  like the following statement.
glutinitwindowsize(GLUT_WINDOW_WIDTH, GLUT_WINDOW_HEIGHT);



C++

Avatar of undefined
Last Comment
Infinity08
Avatar of jsbsudha
jsbsudha
Flag of Germany image

ASKER

glutInitWindowSize(glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT));

It shows error
Avatar of Infinity08
Infinity08
Flag of Belgium image

It is recommended to use glutReshapeFunc for obtaining the exact size of the window :

        http://www.opengl.org/documentation/specs/glut/spec3/node48.html

You register a callback function with it that will be called whenever the window's size changes.
Avatar of jsbsudha
jsbsudha
Flag of Germany image

ASKER

I have trioed using Reshape func it is  not updating.......i want  my GLUT window to be in full screen according to the window size........Now I am using glut fullscreen  as a temporary solution........If you can provide me a code  such that the size of the window is determined  by itself so that the user need not specify any size for it....
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of jsbsudha
jsbsudha
Flag of Germany image

ASKER

I want windowed mode but it should be maximized to full screen
Avatar of jsbsudha
jsbsudha
Flag of Germany image

ASKER

Automatically when i execute the program it should fir my window size in  windowed mode......like maximizing the window....
SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
C++
C++

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.

58K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo