Question regarding a lag when drawing highlight circles:

Hi all,

I am developing a game environment to utilize the maps created in an editor using D2D/GDI+. I use wxWidgets to switch between the map editor and the game environment (GE) which using an OpenGL Context to draw and render. Now loading the created maps works seamlessly, and after having written implementation to handle a global key-states class so that map scrolling using the arrow keys is handled upon the drawing of a new frame rather than the native event handler present in the GUI API, I soon wrote the code to highlight placed map assets depending on their type.
I have the current to-be-highlighted type set to highlight units placed on the map. Within a renderMap() function which is called to render to a framebuffer before rendering a final composite queue within the draw loop I have code written which draws the highlight before drawing the asset’s image–this works fine and gives the impression that the highlight circle is behind the placed map assets. However, when I move the map around I notice that there is a slight lag between the map being drawn near instantaneously and the yellow highlight circles which “fall” into place a moment later. The code to draw the highlight circles is written before the map-drawing code, as mentioned above, and so the phenomenon is quite strange: the map editor’s drawing functionality appears to be much slower than OpenGL (this was my reason for moving to OpenGL in the original matter) and yet the circle-highlighting there works without the lag.

Here is a pair of images to describe the issue visually:

Image Pair (Moving/Non-moving)

What might be the issue present here? Rendering text does not seem to present the same issue when moving the map around.

Thanks for any help or suggestions.

The problem was solved once the view matrices for the map rendering shader and highlighting shaders were looked at. The map’s view matrix was updated immediately after the update to the view matrix was processed; but because of the highlighting shader’s position in the code it was forced to wait until the next loop in the program before being updated. Moving the update to the view matrix up in the code solved the issue.