Skip to main content
gamedev.net
🔒 Locked

Strange delay work program

Started by sgi1981 0 replies 700+ views
Original Post
sgi1981
sgi1981
Hello. The problem is those. There is videoadapter GeForce 9600 GT/PCI/SSE2 Driver version 6.14.11.8048. GL Version 2.1.2. I have written the program using OpenGL. Mistakes in the program are not present. In the beginning I have noticed strange delay of reaction of the program on movements of the mouse. At movement of the mouse in my program the camera should turn. But turn of the camera has not always time to be carried out, and the central processor was loaded enough. I have thought, that some functions OpenGL are slowly carried out, and began to frame separate functions in the comment. And thus, I have noticed, that if to exclude calls of functions such as glIsEnabled, glGetFloatv, glGetIntegerv the program is carried out without a delay. These functions, as is known, return values of working parameters OpenGL. I was asked a question, whether really these functions are carried out slowly. For this purpose I have added a cycle where these functions were caused with various parameters. In the first experiment - I have added this cycle up to a call of function SwapBuffers. In the second experiment - this cycle was not up to SwapBuffers, and after SwapBuffers. 1 experiment. If the quantity of calls of function glIsEnabled as a result of performance of all iterations of a cycle will be more than 150 - that the program works without a delay, and also the central processor is not loaded. If this quantity will be less than 150 also the central processing UNIT is loaded, and delay of work of the program will be. 2 experiment. If the quantity of calls of function glIsEnabled as a result of performance of all iterations of a cycle will be more than 150 - that the program works without a delay, and also the central processor is not loaded. If this quantity will be less than 150 the central processing UNIT is loaded, but delay of work of the program is not observed. Recommendations are necessary for me.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.