GLUT screen increases while dragging (2/4)

When i drag a GLUTwindow by clinging to the titlebar, the screensize elongates. For non english speakers the screensize gets bigger from the moment you click.

I did get this message while compiling:
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run “cmake --help-policy CMP0072” for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

FindOpenGL found both a legacy GL library:

OPENGL_gl_LIBRARY: /usr/lib/aarch64-linux-gnu/libGL.so

and GLVND libraries for OpenGL and GLX:

OPENGL_opengl_LIBRARY: /usr/lib/aarch64-linux-gnu/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib/aarch64-linux-gnu/libGLX.so

OpenGL_GL_PREFERENCE has not been set to “GLVND” or “LEGACY”, so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

– Found OpenGL: /usr/lib/aarch64-linux-gnu/libOpenGL.so
– Configuring done
– Generating done
– Build files have been written to:
does this message matter ?

Hi,
Not sure if the warning matters. We would need to replicate the issue and investigate. Please check if it can be reproduced on Orin Nano developer kit. If yes, please share us the steps.

So the software was developed on a B1-developement board and a Jetson Nano module, i transferred the software to a Jetson Orin nano developersboard, recompiled it using :

cmake (3.16.3-1ubuntu1.20.04.1)
freeglut3 (2.8.1-3) and
gcc 4.9.3.0-1ubuntu2

after < cmake . >i get the above message.
after < make > i get the next message:

. . . aal/collector.cu: In function ‘void display_func()’:
. . . aal/collector.cu:1861:22: warning: ‘] G.goal[’ directive writing 9 bytes into a region of size between 0 and 1 [-Wformat-overflow=]
1861 | sprintf(messagelist,“I/O_%d [S]%d [L]%d > G.revmid[%d] G.goal[%d]”,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. . . aal/collector.cu:1861:8: note: ‘sprintf’ output between 42 and 92 bytes into a destination of size 31
1861 | sprintf(messagelist,“I/O_%d [S]%d [L]%d > G.revmid[%d] G.goal[%d]”,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. . . aal/collector.cu:1864:22: warning: ‘ , tijddrempel ’ directive writing 15 bytes into a region of size between 0 and 8 [-Wformat-overflow=]
1864 | sprintf(messagelist,“getal = %d , lees/loep %d , tijddrempel %ld , tijdtel %ld”, getal, tijdloep, tijddrempel, tijdtel);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aal/collector.cu:1864:8: note: ‘sprintf’ output between 53 and 111 bytes into a destination of size 31
1864 | sprintf(messagelist,“getal = %d , lees/loep %d , tijddrempel %ld , tijdtel %ld”, getal, tijdloep, tijddrempel, tijdtel);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scanning dependencies of target collec
[100%] Linking CXX executable collec
[100%] Built target collec
<< which are of no consequence to the mentioned error.
Is this answer elaborate enough , something you can work with ?

Hi,
We would like to replicate the dragging on developer kit. Please check if you can share a test code so that we can compile and run.

#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
/* macros */
#define SWAP(x0,x) {float * tmp=x0;x0=x;x=tmp;}
/* global variables */
static int win_id;
static int win_x, win_y;

void gldraw_something()
{
    float xflid = 0.0;	float yflid = 0.0;
    float xflidmax = 0.0;	float yflidmax = 0.0;
	glPointSize(25);
    glBegin(GL_POINTS);
		glColor3f(0.7 , 0.75, 0.25);
		glVertex2f(0.50, 0.50);
    glEnd();
     glBegin(GL_LINE_STRIP);
		xflid = 0.25;xflidmax=0.75;
		yflid = 0.25;yflidmax=0.75;
		glColor3f(0.9 , 0.75, 0.9);
		glVertex2f(xflid, yflid);
		glVertex2f(xflid, yflidmax);
		glVertex2f(xflidmax, yflidmax);
		glVertex2f(xflidmax, yflid);
		glVertex2f(xflid, yflid);
    glEnd();
}

static void pre_display ( void )
{
	glViewport ( 0, 0, win_x, win_y );
	glMatrixMode ( GL_PROJECTION );
	glLoadIdentity ();
	gluOrtho2D ( 0.0, 1.0, 0.0, 1.0 );
	glClearColor ( 0.0f, 0.0f, 0.0f, 1.0f );
	glClear ( GL_COLOR_BUFFER_BIT );
}

static void post_display ( void )
{
	glutSwapBuffers ();
}

static void key_func ( unsigned char key, int x, int y )
{
	if ( key==27 )	exit ( 0 );
}

static void reshape_func ( int width, int height )
{
	glutSetWindow ( win_id );
	glutReshapeWindow ( width, height );
	win_x = width;
	win_y = height;
}

static void idle_func ( void )
{
	glutSetWindow ( win_id );
	glutPostRedisplay ();
}

static void display_func ( void )
{
	pre_display ();
		gldraw_something();
	post_display ();
}

static void open_glut_window ( void )
{
	glutInitDisplayMode ( GLUT_RGBA | GLUT_DOUBLE );
	glutInitWindowPosition ( 0, 0 );
	glutInitWindowSize ( win_x, win_y );
	win_id = glutCreateWindow ( "Ex ample sufficient"  );
	glClearColor ( 0.0f, 0.0f, 0.0f, 1.0f );
	glClear ( GL_COLOR_BUFFER_BIT );
	glutSwapBuffers ();
	glClear ( GL_COLOR_BUFFER_BIT );
	glutSwapBuffers ();
	pre_display ();
	glutKeyboardFunc ( key_func );
	glutReshapeFunc ( reshape_func );
	glutIdleFunc ( idle_func );
	glutDisplayFunc ( display_func );
}

int main ( int argc, char ** argv )
{
	glutInit ( &argc, argv );
	//win_x = 1920;	win_y = 1080;
	win_x = 800;	win_y = 600;
	open_glut_window ();
	glutMainLoop ();
	exit ( 0 );
}

//( i don’t know how to differ between ordinary text and programming code )

I am curious about drivers present. If you don’t have “glxinfo”, then you can install it with “sudo apt-get install mesa-utils”. What do you see from:
glxinfo | egrep -i '(version|nvidia)'
(this has to be run from the GUI screen)

Hi,
Thanks for sharing the test sample. Please share the command for building the sample.

@DaneLLL
gcc minifaultversion.c -ovoila -lGL -lglut -lGLU

@linuxdev, i can’t place the (this has to be run from the GUI screen) remark, hope this is what you requested:
glxinfo | egrep -i ‘(version|nvidia)’
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
GLX version: 1.4
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA Tegra Orin (nvgpu)/integrated
OpenGL core profile version string: 4.6.0 NVIDIA 35.3.1
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 35.3.1
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 35.3.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
GL_EXT_shader_group_vote, GL_EXT_shader_implicit_conversions,

cheers DO_Ray

Yes, that is useful. It just verifies that the NVIDIA drivers are still in place, and that Mesa has not overwritten anything.

Hi,
We run the application on host PC in Ubuntu 20.04(with RTX 3070) and the behavior is same as on Orin Nano developer kit. It seems like there is bug in the test code. Could you check this?

I will

I compiled it on the older Jetson Nano 4Gb, there it worked like a charm.
So the problem realy is in the Jetson Orin nano.

@linuxdev i also did that glxinfo thingy on the Jetson Nano 4Gb with this result:
glxinfo | egrep -i ‘(version|nvidia)’
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
GLX version: 1.4
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA Tegra X1 (nvgpu)/integrated
OpenGL core profile version string: 4.6.0 NVIDIA 32.7.4
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 32.7.4
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 32.7.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
GL_EXT_shader_group_vote, GL_EXT_shader_implicit_conversions,

Hope it helps.

There are cases where the purely software drivers from Mesa can overwrite NVIDIA drivers. That command verifies that this has not occurred, and that the NVIDIA drivers are correctly in place.

i dissected the reshape function and the problem lays within <glutReshapeWindow ( width, height )> .
When resizing horizontaly the height also jumps to the full height of the screen.
When resizing vertical it toggles between the mouse position and an increasing height.
while dragging the titlebar the height increases until the screenheight.

SOLVED / work around change reshape_func() into this one:

static void reshape_func ( int width, int height )
{
	//glutReshapeWindow ( width, height );
	win_x = width;
	win_y = height;
}
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.