OpenGL stopped rendering - opengl

First things first: Platform is Windows 7 64-bit, language is VC++, IDE is VS2010. Graphics card is nVidia GTX 460, drivers are version 290.53.
So here's the situation. I am currently working in OpenGL using Glew 1.7 and Glut. I set everything up a few days ago and managed to successfully code and complete an assignment for my classes. The assignment ran beautifully and displayed and did everything it was supposed to. That was wonderful. So I submitted my assignment and didn't touch it again until tonight.
Now, tonight I tried running the code again and instead of my beautifully tessellated polygons I am getting a plain white window. As far as I know, nothing related to OpenGL has changed on my system since I last ran the code. I haven't changed the code at all, I haven't changed the graphics drivers, I haven't changed anything that I am aware of. I couldn't seem to find anything related to this kind of problem, and I am at a loss of what could possibly be causing the issue. I even tried recompiling Glew, but it didn't change anything. I know it's not a code issue since it was working fine a few days ago and nothing has changed, so it has to be a configuration issue.
Could someone please point me in the right direction?
Edit
One more thing to add to this. When I was originally doing the project in question, attempting to run it produced the error message "unable to find glew32d.dll" until I placed glew32d.dll and glut32.dll in the source folder of my project.
Now, I don't remember deleting them from my project folder, but when I tried to debug it last night, I noticed that both of them had disappeared from my project folder. However, I was not getting any .dll missing errors. Replacing them in the folder didn't solve the problem, but I am wondering if their disappearance has something to do with this. They are also located in the VC/bin/ directory of the VS2010 install path, and deleting them from both locations produces the error message, but having them in either location is now sufficient for building and running when previously I needed them in both.

One possibility is that you're scaling by an infinite value (1.#INF), or something of the sort. I've run into a very similar situation, and that turned out to be the problem. However, if you have not changed the code, then you may be able to rule this out. Have you tried throwing in some code to render a simple quad or triangle to the screen?
As for the .dlls, I recommend putting them in your C:/Windows/SysWOW64 and C:/Windows/System32 folders. SysWOW64 specifically houses all the 32-bit .dlls, but it's safe to put them in both locations. Visual Studio will look in both your project folder and these system folders for necessary dynamic libraries. The advantage of placing them in the system folders is that they are then available for all OpenGL applications you may write.
One last thing that might help in finding the issue is making use of OpenGL's error reporting. You can use a function such as:
void HandleGLError()
{
GLenum error;
int i = 0;
while ((error = glGetError()) != GL_NO_ERROR) {
printf("GL ERROR(%d) %s\n",i,gluErrorString(error));
i++;
}
}
Try calling that at the beginning and end of your render function, and in any other places you think might be causing a problem.

Related

glfwInit takes 20 seconds

I never had an issue with this until recently, but glfwInit() always takes 20 seconds to execute. I have seen the other stackoverflows and github issues pertaining to driver issues - but I do not have the same devices as the ones people talk about, and with the devices and drivers (fully updated) I do have, I have never had this issue until now.
RB_CORE_INFO("Creating window {0} ({1}, {2})", props.title, props.width, props.height); // log macro - for example, will print at 10:30:00
if (!gGlfwInitialized)
{
RB_CORE_TRACE("Initializing GLFW"); // prints at 10:30:00
const int success = glfwInit(); // takes 20 seconds
RB_CORE_ASSERT(success, "Could not initialize GLFW")
RB_CORE_TRACE("GLFW Initialized"); // prints at 10:30:20
glfwSetErrorCallback(GlfwErrorCallback);
gGlfwInitialized = true;
}
RB_CORE_TRACE("Creating glfw window");
mWindow = glfwCreateWindow(static_cast<int>(props.width), static_cast<int>(props.height), mData.title.c_str(),
nullptr, nullptr);
A snippet of my code, though I'm quite positive the issue is not my code. Whether my issue is glfw or windows 11 I am not sure, but I'm going mad trying to figure it out. Other work arounds and causes I've found online do not seem to be my case, as far as I can figure at least.
Any help is greatly appreciated.
For reference, I run Windows 11, fully updated and all drivers updated. RTX 3080 gpu and a Ryzen 5900x cpu. Some people have blamed Corsair keyboards, though I have a Ducky keyboard and it doesn't seem to be the cause either.
Note: I've rebooted many times since I first started having this issue a couple days ago.
Edit:
It does seem the issue is related to this and this however these point to a device driver with VID_262 in the hardware ID. But as I do not have any with that particular VID_262 I'm not sure where to start looking. Using DevCon.exe I generated this list but even after unplugging every device one by one, I can't find the issue. As of this edit, I've not yet been able to try running this on another device.
So it turns out VCPKG is evil. I started having more issues - being that ImGui first compiled, but would give me read access violations when I used their NewFrame function. Then it turned into linking errors and a whole bunch of things that really started to confuse me. Even though I'm taking all my libraries from my own folder via premake, it seems Visual Studio has gotten confused and was trying to link both my generated lib files with lib files I had installed on vcpkg.
Turning off vcpkg has fixed both my linking errors and now makes glfw init very fast. I guess I should just uninstall vcpkg completely so it fixes the problem for other games or applications that use things like glfw.
Long story short, VCPKG is a nightmare on my system.

Chromium-browser build fatal errors in module_list.cc: Check Failed

I've been trying to build chromium on Windows 10, but I am getting weird errors on runtime, which appear to be caused by that pattern:
void CheckFreeLibrary(HMODULE module) {
BOOL result = ::FreeLibrary(module);
DCHECK(result);
}
The first errors are displayed after a few seconds after Chromium is started. Here's what it says:
[5904:9192:0726/025753:FATAL:module_list.cc(18)] Check failed: result.
Backtrace:
base:debug:StackTrace:StackTrace [0x0000....] (e:\projects\clones\chromium\src\base\debug\stack_trace.cc) ...
Since I couldn't copy paste the whole stack, I will join a screenshot of what it all feels like:
I am successful in building the last revision, or at least, it appears to be successful since no errors are showing up when compiling with the toolchain recommended in Building instructions.
Luckily, the first errors aren't modal and it is possible to browse a little bit afterwards. Then, if I put the application into heavy loading (such as Facebook newsfeed), it will suddently stop responding in a silent way. Mouse hovering effects will not show anymore and reloading the page will result in infinite loading. This behavior is also reproductible when right-clicking on some pages (e.g.: google's home page does it sometimes).
What could be an explanation of this not working "out of the box" with default configuration? How to fix this?
P.S.: This question is complementary to this question:
Windows chromium-browser fresh build stacktrace and anonymous fatal errors on runtime, if it can help getting the big picture of the question.
P.S.2.: I am currently trying to rebuild from start again with this slight change to see if it works out better. I will be able to see it after about 10 hours, though (yes, the build is painful on my current setup).
void CheckFreeLibrary(HMODULE module) {
BOOL result = ::FreeLibrary(module);
if (!result) {
result = ::UnmapViewOfFile(module);
}
DCHECK(result);
}
Update - 2016/07/29
Test with CheckFreeLibrary still failed in debug, but I finally found a way to resolve the issues in a build. See update 3 in superuser question. What I did was configuring the build into release mode via gn args. This is, obviously, almost impossible to debug with, so a solution / explanation is yet to be found about why it fails in debug mode. This is quite close now, though.
Update 2 - 2016/08/13
Started all over again to have a debug version again with the latest version in the repositories, and this time I was sure enough to find something. In fact, after I've run through the usual procedure to update, generate and build, I noticed that some win-core-* DLL libraries located in the Windows Kit debugger weren't copied src folder but one of those was assumed to be there during the link process. As a precaution, I've simply copied them all to be sure that any delay-load or build dependency was there. The first time chromium has launched, the errors didn't show up and thought it was resolving the issue. However, right-clicking on the Google Homepage had the same effect (no response, then browser not showing pages anymore). After closing and reopening it, errors are beginning to show up.
Is there anyone that had experienced that? I would be very happy with something like "do it on linux, it works better on this platform". I am not willing to do it without knowing it will work any better, though.
So
BOOL result = ::FreeLibrary(module);
fails in debug builds see if you have a
DWORD WINAPI GetLastError(void);
to get the real error.
I could guess
module not loaded
module is NULL
Perhaps some DEBUG statement is changing the value of module?

Works when run from Visual C++ but sometimes not standalone

The actual question: what are the differences between running in Visual C++ 2010 (both release and debug mode) and standalone, excluding anything that couldn't cause the problem stated at the bottom of this post?
I have a very specific problem with my program, so I am not going to post the code. If you would like to know details of the problem to gain some understanding, I post them at the bottom. Instead, I ask: what are the differences in running in visual c++ and standalone?
I am using Visual C++ 2010, and my program is using SFML 2.0. It runs fine in studio (I am calling it studio because it is easier to type), but when run standalone on some computers only a bug will occur within the program, to do with movement being delayed but other parts not. I cannot find any links between the computer specs of the users who test it and whether they work or not.
All dlls and such are included (at least, I think they are - the program runs fine, as detailed at the bottom - maybe some users have some framework installed?). On my computer, it works all the time in studio but not standalone. On my netbook, it works, on my older computer, it doesn't. The only project settings I changed with vc++ directories and linker settings.
Problem details:
All the sounds sound slightly different and there is a possible high pitched background noise. Character movement, enemy movement and space bar delay which is supposed to be 0.5 seconds is increased to about 5 seconds but "generating pixels" (an aspect in the game with the arrow keys isn't.
I'm stressing again that it only happens on SOME COMPUTERS, mine included, but always works when run within studio. A number of people have tested the game, and some reported the problem and others different.
[NOT THE MAIN POINT OF THE QUESTION BUT HERE IS AN EXTRA BIT: If you are so willing to help me that you wish to look through the entire source code, it's here: http://dl.dropbox.com/u/53835113/EVERYTHING.zip [note: ignore the massive amount of bugs and memory leaks other than the problem described :P]]
EDIT: THE POINT ISN'T THAT I WANT MY PROGRAM DEBUGGED! That is an optional extra. The question: what are the differences in running in visual c++ and standalone?
More edits: Found that the problem is due to the frame time not being correct. Not sure if this provides some insight.
Thanks to anyone who tries to help me!
GetFrameTime() in SFML was removed in a recent version because it returns the time since last frame rather than the time since last update. As a result, the it may return 0.

Direct3D strange crash

I have Direct3D rendering library compiled with VS2008. The another application (built with VS2008) uses my library and everything works fine.
Recently, parent application was moved to VS2010 but my library is still being built under VS2008. And still everything works fine BUT one call on only ONE sprite.
D3DXSprite->Draw method crashes in D3DX9_43.dll in D3DXCore::CSprite::Draw() method. And it occurs only when I'm trying to draw a specific element from texture.
I've also tried to rebuild my library under VS2010, but no success. Crash still occurs.
Any ideas?
Thanks!
This may not be want you want to hear, but all I can suggest for debugging something like this is the liberal use of break points and special debugging if-statements.
Place a try-catch statement around the render function that is failing and place a breakpoint in the catch block.
You may need to add some counters and debugging variables so that you can monitor the size/cont of your data structures vs. what your rendering code actually processed.
If you still don't have any hints, it's time to temporarily fork your code (copy it) and simplify. Start ripping out chunks of code to see if it still fails. Eventually you'll narrow it down.
Good luck.

Invalid lock sequence error in an OpenSceneGraph application

I have an application that is built against OpenSceneGraph (2.6.1) and therefore indirectly OpenGL. The application initializes and begins to run, but then I get the following exception "attempt was made to execute an invalid lock sequence" in OpenGL32.dll. When I re-run it, I sometimes get this exception, and sometimes an exception about a "privileged instruction". The call stack looks like it is corrupted, so I can't really tell exactly where the exception is being thrown from. I ran the app quite a bit a couple of days ago and never saw this behavior. Since then I have added an else clause to a couple of ifs, and that is all. My app is a console application, is built with Visual Studio 2008, and it sets OpenScenGraph to SingleThreaded mode. Anybody seen this before? Any debugging tips?
Can you reproduce it with one of the standard examples?
Can you create a minimal app that causes this?
Do you have a machine with a different brand video card you can test it on (eg Nvidia vs. ATI) there are some issues with openscenegraph and bad OpenGL drivers.
Have you tried posting to osg-users#lists.openscenegraph.org
The problem turned out to be our app was picking up an incorrect version of the OpenGL DLL , instead of the one installed in System32.