| Index: tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
|
| diff --git a/tools/viewer/sk_app/unix/GLWindowContext_unix.cpp b/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
|
| similarity index 73%
|
| copy from tools/viewer/sk_app/unix/GLWindowContext_unix.cpp
|
| copy to tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
|
| index cde1eb2b5c615cbcae2186340585840b074c55ff..aa700e31656ecb12bdac283711bd77c39f7191ae 100644
|
| --- a/tools/viewer/sk_app/unix/GLWindowContext_unix.cpp
|
| +++ b/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
|
| @@ -6,17 +6,17 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| -#include "GLWindowContext_unix.h"
|
| +#include "GLWindowContext_mac.h"
|
|
|
| -#include <GL/gl.h>
|
| +//#include <GL/gl.h>
|
|
|
| -#include "Window_unix.h"
|
| +#include "Window_mac.h"
|
|
|
| namespace sk_app {
|
|
|
| // platform-dependent create
|
| GLWindowContext* GLWindowContext::Create(void* platformData, const DisplayParams& params) {
|
| - GLWindowContext_unix* ctx = new GLWindowContext_unix(platformData, params);
|
| + GLWindowContext_mac* ctx = new GLWindowContext_mac(platformData, params);
|
| if (!ctx->isValid()) {
|
| delete ctx;
|
| return nullptr;
|
| @@ -24,24 +24,30 @@ GLWindowContext* GLWindowContext::Create(void* platformData, const DisplayParams
|
| return ctx;
|
| }
|
|
|
| -GLWindowContext_unix::GLWindowContext_unix(void* platformData, const DisplayParams& params)
|
| +GLWindowContext_mac::GLWindowContext_mac(void* platformData, const DisplayParams& params)
|
| : GLWindowContext(platformData, params)
|
| +#if 0
|
| + // TODO: init Mac-specific OpenGL objects
|
| , fDisplay(nullptr)
|
| , fWindow(0)
|
| - , fGLContext(0) {
|
| + , fGLContext(0)
|
| +#endif
|
| + {
|
|
|
| // any config code here (particularly for msaa)?
|
|
|
| this->initializeContext(platformData, params);
|
| }
|
|
|
| -GLWindowContext_unix::~GLWindowContext_unix() {
|
| +GLWindowContext_mac::~GLWindowContext_mac() {
|
| this->destroyContext();
|
| }
|
|
|
| -void GLWindowContext_unix::onInitializeContext(void* platformData, const DisplayParams& params) {
|
| - ContextPlatformData_unix* unixPlatformData =
|
| - reinterpret_cast<ContextPlatformData_unix*>(platformData);
|
| +void GLWindowContext_mac::onInitializeContext(void* platformData, const DisplayParams& params) {
|
| +#if 0
|
| + // TODO: Init for Mac
|
| + ContextPlatformData_mac* unixPlatformData =
|
| + reinterpret_cast<ContextPlatformData_mac*>(platformData);
|
|
|
| if (unixPlatformData) {
|
| fDisplay = unixPlatformData->fDisplay;
|
| @@ -76,22 +82,29 @@ void GLWindowContext_unix::onInitializeContext(void* platformData, const Display
|
| (unsigned int*)&fWidth, (unsigned int*)&fHeight, &border_width, &depth);
|
| glViewport(0, 0, fWidth, fHeight);
|
| }
|
| +#endif
|
| }
|
|
|
| -void GLWindowContext_unix::onDestroyContext() {
|
| +void GLWindowContext_mac::onDestroyContext() {
|
| +#if 0
|
| + // TODO: teardown for Mac
|
| if (!fDisplay || !fGLContext) {
|
| return;
|
| }
|
| glXMakeCurrent(fDisplay, None, nullptr);
|
| glXDestroyContext(fDisplay, fGLContext);
|
| fGLContext = nullptr;
|
| +#endif
|
| }
|
|
|
|
|
| -void GLWindowContext_unix::onSwapBuffers() {
|
| +void GLWindowContext_mac::onSwapBuffers() {
|
| +#if 0
|
| + // TODO: swap for Mac
|
| if (fDisplay && fGLContext) {
|
| glXSwapBuffers(fDisplay, fWindow);
|
| }
|
| +#endif
|
| }
|
|
|
|
|
|
|