Added window parameter to glfwSwapBuffers.

master
Camilla Berglund ago%!(EXTRA string=13 years)
parent aff30d0baa
commit 585a840329
  1. 2
      examples/boing.c
  2. 2
      examples/gears.c
  3. 2
      examples/heightmap.c
  4. 2
      examples/splitview.c
  5. 2
      examples/triangle.c
  6. 6
      examples/wave.c
  7. 2
      include/GL/glfw3.h
  8. 1
      readme.html
  9. 4
      src/cocoa_opengl.m
  10. 2
      src/internal.h
  11. 12
      src/opengl.c
  12. 4
      src/win32_opengl.c
  13. 2
      src/window.c
  14. 5
      src/x11_opengl.c
  15. 2
      tests/accuracy.c
  16. 2
      tests/clipboard.c
  17. 2
      tests/events.c
  18. 2
      tests/fsaa.c
  19. 2
      tests/fsfocus.c
  20. 2
      tests/gamma.c
  21. 2
      tests/iconify.c
  22. 2
      tests/joysticks.c
  23. 2
      tests/modes.c
  24. 2
      tests/peter.c
  25. 2
      tests/reopen.c
  26. 5
      tests/sharing.c
  27. 2
      tests/tearing.c
  28. 2
      tests/title.c
  29. 2
      tests/windows.c

@ -617,7 +617,7 @@ int main( void )
display();
/* Swap buffers */
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
/* Check if we are still running */

@ -368,7 +368,7 @@ int main(int argc, char *argv[])
animate();
// Swap buffers
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
}

@ -663,7 +663,7 @@ int main(int argc, char** argv)
glDrawElements(GL_LINES, 2* MAP_NUM_LINES , GL_UNSIGNED_INT, 0);
/* display and process events through callbacks */
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
/* Check the frame rate and update the heightmap if needed */
dt = glfwGetTime();

@ -500,7 +500,7 @@ int main(void)
drawAllViews();
// Swap buffers
glfwSwapBuffers();
glfwSwapBuffers(window);
do_redraw = 0;
}

@ -89,7 +89,7 @@ int main(void)
glEnd();
// Swap buffers
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
if (glfwGetKey(window, GLFW_KEY_ESCAPE))

@ -145,7 +145,7 @@ void init_grid(void)
// Draw scene
//========================================================================
void draw_scene(void)
void draw_scene(GLFWwindow window)
{
// Clear the color and depth buffers
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@ -162,7 +162,7 @@ void draw_scene(void)
glDrawElements(GL_QUADS, 4 * QUADNUM, GL_UNSIGNED_INT, quad);
glfwSwapBuffers();
glfwSwapBuffers(window);
}
@ -450,7 +450,7 @@ int main(int argc, char* argv[])
adjust_grid();
// Draw wave grid to OpenGL display
draw_scene();
draw_scene(window);
glfwPollEvents();
}

@ -581,7 +581,7 @@ GLFWAPI void glfwSetTime(double time);
/* OpenGL support */
GLFWAPI void glfwMakeContextCurrent(GLFWwindow window);
GLFWAPI GLFWwindow glfwGetCurrentContext(void);
GLFWAPI void glfwSwapBuffers(void);
GLFWAPI void glfwSwapBuffers(GLFWwindow window);
GLFWAPI void glfwSwapInterval(int interval);
GLFWAPI int glfwExtensionSupported(const char* extension);
GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);

@ -288,6 +288,7 @@ version of GLFW.</p>
<li>Added <code>modes</code> video mode enumeration and setting test program</li>
<li>Added <code>glfw3native.h</code> header and platform-specific functions for explicit access to native display, window and context handles</li>
<li>Added <code>glfwSetGamma</code>, <code>glfwSetGammaRamp</code> and <code>glfwGetGammaRamp</code> functions and <code>GLFWgammaramp</code> type for monitor gamma ramp control</li>
<li>Added window parameter to <code>glfwSwapBuffers</code></li>
<li>Changed buffer bit depth parameters of <code>glfwOpenWindow</code> to window hints</li>
<li>Changed <code>glfwOpenWindow</code> and <code>glfwSetWindowTitle</code> to use UTF-8 encoded strings</li>
<li>Changed <code>glfwGetProcAddress</code> to return a (generic) function pointer</li>

@ -51,10 +51,8 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
// Swap buffers
//========================================================================
void _glfwPlatformSwapBuffers(void)
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
{
_GLFWwindow* window = _glfwLibrary.currentWindow;
// ARP appears to be unnecessary, but this is future-proof
[window->NSGL.context flushBuffer];
}

@ -324,7 +324,7 @@ void _glfwPlatformWaitEvents(void);
// OpenGL context management
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
void _glfwPlatformSwapBuffers(void);
void _glfwPlatformSwapBuffers(_GLFWwindow* window);
void _glfwPlatformSwapInterval(int interval);
void _glfwPlatformRefreshWindowParams(_GLFWwindow* window);
int _glfwPlatformExtensionSupported(const char* extension);

@ -541,21 +541,17 @@ GLFWAPI GLFWwindow glfwGetCurrentContext(void)
// Swap buffers (double-buffering)
//========================================================================
GLFWAPI void glfwSwapBuffers(void)
GLFWAPI void glfwSwapBuffers(GLFWwindow handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
if (!_glfwLibrary.currentWindow)
{
_glfwSetError(GLFW_NO_CURRENT_CONTEXT, NULL);
return;
}
_glfwPlatformSwapBuffers();
_glfwPlatformSwapBuffers(window);
}

@ -545,10 +545,8 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
// Swap buffers (double-buffering)
//========================================================================
void _glfwPlatformSwapBuffers(void)
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
{
_GLFWwindow* window = _glfwLibrary.currentWindow;
SwapBuffers(window->WGL.DC);
}

@ -344,7 +344,7 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
// Clearing the front buffer to black to avoid garbage pixels left over
// from previous uses of our bit of VRAM
glClear(GL_COLOR_BUFFER_BIT);
_glfwPlatformSwapBuffers();
_glfwPlatformSwapBuffers(window);
return window;
}

@ -642,10 +642,9 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
// Swap OpenGL buffers
//========================================================================
void _glfwPlatformSwapBuffers(void)
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
{
glXSwapBuffers(_glfwLibrary.X11.display,
_glfwLibrary.currentWindow->X11.handle);
glXSwapBuffers(_glfwLibrary.X11.display, window->X11.handle);
}

@ -113,7 +113,7 @@ int main(void)
glVertex2f((GLfloat) cursor_x, (GLfloat) window_height);
glEnd();
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
}

@ -143,7 +143,7 @@ int main(int argc, char** argv)
glColor3f(0.8f, 0.2f, 0.4f);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwWaitEvents();
}

@ -239,7 +239,7 @@ static void window_refresh_callback(GLFWwindow window)
printf("%08x at %0.3f: Window refresh\n", counter++, glfwGetTime());
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwSwapBuffers(window);
}
static void window_focus_callback(GLFWwindow window, int activated)

@ -147,7 +147,7 @@ int main(int argc, char** argv)
glEnable(GL_MULTISAMPLE_ARB);
glRectf(-0.15f, -0.15f, 0.15f, 0.15f);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
}

@ -101,7 +101,7 @@ int main(void)
while (running)
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwWaitEvents();
}

@ -158,7 +158,7 @@ int main(int argc, char** argv)
glColor3f(0.8f, 0.2f, 0.4f);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
}

@ -152,7 +152,7 @@ int main(int argc, char** argv)
glClearColor(1, 1, 1, 0);
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
}

@ -205,7 +205,7 @@ int main(void)
refresh_joysticks();
draw_joysticks();
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
}

@ -148,7 +148,7 @@ static void test_modes(void)
while (glfwGetTime() < 5.0)
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
if (!window)

@ -131,7 +131,7 @@ int main(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwSwapBuffers(window_handle);
glfwWaitEvents();
}

@ -147,7 +147,7 @@ int main(int argc, char** argv)
glRectf(-0.5f, -0.5f, 1.f, 1.f);
glPopMatrix();
glfwSwapBuffers();
glfwSwapBuffers(window_handle);
glfwPollEvents();
if (closed)

@ -172,11 +172,12 @@ int main(int argc, char** argv)
{
glfwMakeContextCurrent(windows[0]);
draw_quad(texture);
glfwSwapBuffers();
glfwMakeContextCurrent(windows[1]);
draw_quad(texture);
glfwSwapBuffers();
glfwSwapBuffers(windows[0]);
glfwSwapBuffers(windows[1]);
glfwWaitEvents();
}

@ -97,7 +97,7 @@ int main(void)
position = cosf(glfwGetTime() * 4.f) * 0.75f;
glRectf(position - 0.25f, -1.f, position + 0.25f, 1.f);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwPollEvents();
}

@ -61,7 +61,7 @@ int main(void)
while (glfwGetCurrentContext())
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwSwapBuffers(window);
glfwWaitEvents();
}

@ -87,7 +87,7 @@ int main(void)
{
glfwMakeContextCurrent(windows[i]);
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwSwapBuffers(windows[i]);
}
glfwPollEvents();

Loading…
Cancel
Save