Pages: 1 2 3
Author Topic: SwapBuffers Issue  (144,212 Views)
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #30 Posted on: May 27, 2013, 04:46:38 PM
Windowing systems need bridged also so the hWnd gets exposed so that it can be attached to a d3ddevice as well.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #31 Posted on: May 27, 2013, 05:19:34 PM
Nope, set_syncronisation() didn't fix that. You can re-implement that function using GLEW like here: http://3dengine.org/Disable_vsync . So it basically is just this:
void set_synchronization(bool enable)
{
    wglSwapIntervalEXT(enable);
}
Note:
1) This function should not be in WindowsSTD, but in OpenGL graphics system for obvious reasons (best one being that it is not platform specific).
2) You will need to include wglew.h, not just glew.h (it should have been included anyway, dunno why it isn't) inside the general/OpenGLHeaders.h.
3) When you do that there will be some problems with inlined min and max functions inside GSColors. I just renamed them to mini and maxi as they are used right there for some clamping, nothing more (and moved them under enigma_user, but I guess that is not necessary).
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #32 Posted on: May 27, 2013, 05:22:31 PM
You can still commit to the repo yourself Deus  XD
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #33 Posted on: May 27, 2013, 05:23:35 PM
Anyway read through what I put. Specifically, check if "enable desktop composition" is definitely set for you..
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #34 Posted on: May 27, 2013, 05:24:16 PM
Here's the issue: wgl is platform-specific. On Windows, it's wgl. On Linux, it's glx. Moreover, wglew is specifically for Windows. We need a Bridges/ folder between platforms and graphics/audio/widget systems.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #35 Posted on: May 27, 2013, 05:26:10 PM
Yeah my bad. Somehow forgot that glew is for windows. Anyway, it's possible to re-implement for windows then.

And I checked, I have everything, including "enable desktop composition" turned on.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #36 Posted on: May 27, 2013, 05:28:11 PM
Quote from: TheExDeus on May 27, 2013, 05:26:10 PM
Yeah my bad. Somehow forgot that glew is for windows. Anyway, it's possible to re-implement for windows then.

And I checked, I have everything, including "enable desktop composition" turned on.
OK. But possibly it's being disabled by your driver when you run the application?
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #37 Posted on: May 27, 2013, 05:53:04 PM
Also that fullscreen bug I mentioned before, looks like this:

http://i.imgur.com/h1CIBcV.png
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #38 Posted on: May 27, 2013, 05:57:11 PM
QuoteOK. But possibly it's being disabled by your driver when you run the application?
It shouldn't be. Especially when ran in windowed mode. I also tried full screen and full screen with display resolution set to the room. In all cases the same result. But as I said, I got this problem with another, totally unrelated PC. Different hardware, clean install etc. So it must be larger than that. Maybe I will try my laptop with AMD later and see if has the same problem.

edit: After a quick profiling I found the problem is setting the room_speed large. The room_speed = 1000 makes the whole thing CPU bound. Even when vsync is on and only 60FPS is possible. But the bound is actually a lot lower than that. At room_speed 59 I get 3% CPU load, at room_speed 60 I get 25%.

edit2: With vsync off I get 0-3% load even with 60FPS. Or 500fps for that matter. But 600FPS again give 25% load. I think the CPU bottlenecks when I make it draw more than I can actually draw. Maybe the opposite, it bottlenecks when I ask for I/O while I can draw a lot faster. Anyway, we should multithread ENIGMA at least partially, so I/O is one thread drawing another.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #39 Posted on: May 28, 2013, 01:08:57 AM
Yes just as Josh said though guys, you should be creating the bridges folder for windowing, because we also need it to hook up a DX device to it.
Pages: 1 2 3