NVIDIA OpenGL driver issue?
Members - Reputation: 881
Posted 05 April 2013 - 07:33 AM
I coded up a super simple program in C# using SFML2.NET with Visual Studio 2012. All it does is create a RenderWindow and move a RectangleShape across the screen and when it gets to the far right then moves it back to the left to repeat. If I run this in fullscreen mode then I have no issues. When I run this in windowed mode I get a strange graphical glitches. About 2-3 times per second (about every 20 or so frames since I run at 60FPS with vsync) then my image for a brief moment jumps backwards as if it were drawn where it was 10-15 frames ago, and then immediately jumps back to where it is supposed to be. Its as if for one frame, it is still drawing a frame from 15 frames ago instead of the current one.
I recreated the same exact program but in C++ with SFML2 using Visual Studio 2012 and has the same results. It is OK in fullscreen but has the issue in windowed mode.
I then recreated the same program in C++ except utilizing DirectX and there is no problems in Windowed mode or fullscreen.
I then recreated the same program in C++ with SFML2 on Ubuntu using the gcc compiler and Code::Blocks. It has no issue in windowed or fullscreen.
So it seems to me there is some kind of OpenGL driver issue on Nvidia in Windows 7. It could just be a bug in the Windows version of SFML2 before it even makes the call to OpenGL. I am going to code just straight to OpenGL instead of going through SFML to see if the problem still repeats itself.
I know this isnt any kind of physics or math issue on my part for the positioning as all I do each frame is do a +2 to the rectangle shapes x position every frame for this test.
Also put a breakpoint in to a conditional statement that if the x position is ever smaller than it was the last frame then it would hit the breakpoint and I could see it. I did make the exception that the breakpoint wouldnt trigger if it is when i manually set the x position to 0 while doing the screen wrap. This would let me detect if something was screwy with the simple math but it never hits the breakpoint saying that the x position is smaller than it was the last frame.
Anyone else have issues like this?
[Edit]Appologies for the formatting of this text. My work computer doesnt display this website correctly and isnt letting me put breaks in the text
Members - Reputation: 881
Posted 05 April 2013 - 08:43 PM
So I just did the test with c++ and straight OpenGL with no SFML and it still has the same issues. Works ok in fullscreen but has the weird jerky jumping in Windowed mode.
I would really rather prefer to do this in SFML/OpenGL to keep it portable, but I need it in windowed mode to make use of the Debugger and if it is windowed then it looks jerky and messed up.