Skip to content

Commit

Permalink
GLX: Remove all Host_GetRenderWindowSize calls.
Browse files Browse the repository at this point in the history
Also remove x, y, width and height from the GLInterface, since it's only
used in GLX, which no longer uses them
  • Loading branch information
lioncash committed Aug 8, 2014
1 parent 7692f5a commit dc2bc62
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 37 deletions.
2 changes: 0 additions & 2 deletions Source/Core/DolphinWX/GLInterface/GLInterface.h
Expand Up @@ -104,8 +104,6 @@ typedef struct {
XSetWindowAttributes attr;
std::thread xEventThread;
#endif
int x, y;
unsigned int width, height;
} GLWindow;

extern GLWindow GLWin;
22 changes: 0 additions & 22 deletions Source/Core/DolphinWX/GLInterface/GLX.cpp
Expand Up @@ -4,8 +4,6 @@

#include <string>

#include "Core/Host.h"

#include "DolphinWX/GLInterface/GLInterface.h"

#include "VideoCommon/RenderBase.h"
Expand Down Expand Up @@ -41,13 +39,6 @@ void cInterfaceGLX::Swap()
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
bool cInterfaceGLX::Create(void *&window_handle)
{
int _tx, _ty, _twidth, _theight;
Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight);

// Control window size and picture scaling
s_backbuffer_width = _twidth;
s_backbuffer_height = _theight;

int glxMajorVersion, glxMinorVersion;

// attributes for a single buffered visual in RGBA format with at least
Expand Down Expand Up @@ -113,26 +104,13 @@ bool cInterfaceGLX::Create(void *&window_handle)
return false;
}

GLWin.x = _tx;
GLWin.y = _ty;
GLWin.width = _twidth;
GLWin.height = _theight;

XWindow.CreateXWindow();
window_handle = (void *)GLWin.win;
return true;
}

bool cInterfaceGLX::MakeCurrent()
{
// connect the glx-context to the window
#if defined(HAVE_WX) && (HAVE_WX)
Host_GetRenderWindowSize(GLWin.x, GLWin.y,
(int&)GLWin.width, (int&)GLWin.height);
XMoveResizeWindow(GLWin.evdpy, GLWin.win, GLWin.x, GLWin.y,
GLWin.width, GLWin.height);
#endif

bool success = glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
if (success)
{
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/DolphinWX/GLInterface/Platform.cpp
Expand Up @@ -135,8 +135,6 @@ bool cPlatform::Init(EGLConfig config, void *window_handle)
ANativeWindow_setBuffersGeometry((EGLNativeWindowType)Host_GetRenderHandle(), 0, 0, format);
int none, width, height;
Host_GetRenderWindowSize(none, none, width, height);
GLWin.width = width;
GLWin.height = height;
GLInterface->SetBackBufferDimensions(width, height);
#endif
return true;
Expand Down
14 changes: 3 additions & 11 deletions Source/Core/DolphinWX/GLInterface/X11_Util.cpp
Expand Up @@ -19,8 +19,7 @@ bool cXInterface::ServerConnect(void)

bool cXInterface::Initialize(void *config, void *window_handle)
{
int _tx, _ty, _twidth, _theight;
XVisualInfo visTemplate;
XVisualInfo visTemplate;
int num_visuals;
EGLint vid;

Expand All @@ -42,13 +41,6 @@ bool cXInterface::Initialize(void *config, void *window_handle)
exit(1);
}

Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight);

GLWin.x = _tx;
GLWin.y = _ty;
GLWin.width = _twidth;
GLWin.height = _theight;

GLWin.evdpy = XOpenDisplay(nullptr);
GLWin.parent = (Window) window_handle;
GLWin.screen = DefaultScreen(GLWin.dpy);
Expand Down Expand Up @@ -81,7 +73,7 @@ void *cXInterface::CreateWindow(void)

// Create the window
GLWin.win = XCreateWindow(GLWin.evdpy, GLWin.parent,
GLWin.x, GLWin.y, GLWin.width, GLWin.height, 0,
0, 0, 1, 1, 0,
GLWin.vi->depth, InputOutput, GLWin.vi->visual,
CWBorderPixel | CWBackPixel | CWColormap | CWEventMask, &GLWin.attr);
wmProtocols[0] = XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", True);
Expand Down Expand Up @@ -131,7 +123,7 @@ void cX11Window::CreateXWindow(void)

// Create the window
GLWin.win = XCreateWindow(GLWin.evdpy, GLWin.parent,
GLWin.x, GLWin.y, GLWin.width, GLWin.height, 0,
0, 0, 1, 1, 0,
GLWin.vi->depth, InputOutput, GLWin.vi->visual,
CWBorderPixel | CWBackPixel | CWColormap | CWEventMask, &GLWin.attr);
wmProtocols[0] = XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", True);
Expand Down

4 comments on commit dc2bc62

@mwoehlke
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit broke rendering. Stuff works in the previous commit; on this commit, there's just a big black nothing. And with #735 merged (7b6b9b0) there is _no render area _at all**.

I'm looking with deep suspicion at the changed calls to XCreateWindow that apparently create a 1×1 window at a location that may or may not be correct...

@lioncash
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's known that this one breaks it. There is a pull request made to fix this, see #789

@magcius
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you resize the window, it should work fine. I thought it was correct because my window manager had a bug that was accidentally always triggering a resize after a window was mapped.

@mwoehlke
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you resize the window, it should work fine.

Huh. Thanks. Anxiously waiting on #789 then, I guess 😄.

Please sign in to comment.