1ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston/*
27d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4Jeremy Huddleston Copyright (c) 2009-2011 Apple Inc.
3ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
4ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston Permission is hereby granted, free of charge, to any person
5ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston obtaining a copy of this software and associated documentation files
6ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston (the "Software"), to deal in the Software without restriction,
7ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston including without limitation the rights to use, copy, modify, merge,
8ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston publish, distribute, sublicense, and/or sell copies of the Software,
9ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston and to permit persons to whom the Software is furnished to do so,
10ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston subject to the following conditions:
11ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
12ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston The above copyright notice and this permission notice shall be
13ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston included in all copies or substantial portions of the Software.
14ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
15ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
19ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston DEALINGS IN THE SOFTWARE.
23ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
24ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston Except as contained in this notice, the name(s) of the above
25ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston copyright holders shall not be used in advertising or otherwise to
26ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston promote the sale, use or other dealings in this Software without
27ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston prior written authorization.
28ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston*/
29a1cb3babbef2af222b839a058694acc82a7074f1Jeremy Huddleston
30a1cb3babbef2af222b839a058694acc82a7074f1Jeremy Huddleston#include "glxclient.h"
31ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston#include "apple_glx_context.h"
32ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston#include "apple_xgl_api.h"
337d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4Jeremy Huddleston#include "glapitable.h"
34ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
357d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4Jeremy Huddlestonextern struct _glapi_table * __ogl_framework_api;
36ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
37ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddlestonvoid
387d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4Jeremy Huddleston__applegl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
39ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston{
4022613d1670e3aafcfd3b95191b908a0adabe3eb9Jeremy Huddleston   struct glx_context *gc = __glXGetCurrentContext();
41ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston   Display *dpy = glXGetCurrentDisplay();
42ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
4380b280db883edc9550484dba03bd5c124b6a9bf9Jeremy Huddleston   if (gc && gc->driContext)
4480b280db883edc9550484dba03bd5c124b6a9bf9Jeremy Huddleston      apple_glx_context_update(dpy, gc->driContext);
45ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston
467d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4Jeremy Huddleston   __ogl_framework_api->Viewport(x, y, width, height);
47ad503c41557606d15b0420c824369456f6d20a8fJeremy Huddleston}
48