add placeholder for EGLOpenGLWindow

This commit is contained in:
Erwin Coumans
2017-01-09 15:59:47 -08:00
parent 0f51fb618d
commit 5e948ebe00
2 changed files with 283 additions and 0 deletions

View File

@@ -0,0 +1,207 @@
//portions of this file are copied from GLFW egl_context.c/egl_context.h
//========================================================================
// GLFW 3.3 EGL - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2002-2006 Marcus Geelnard
// Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would
// be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//
//========================================================================
#ifdef BT_USE_EGL
#include "EGLOpenGLWindow.h"
struct EGLInternalData2
{
bool m_isInitialized;
int m_windowWidth;
int m_windowHeight;
b3KeyboardCallback m_keyboardCallback;
b3WheelCallback m_wheelCallback;
b3ResizeCallback m_resizeCallback;
b3MouseButtonCallback m_mouseButtonCallback;
b3MouseMoveCallback m_mouseMoveCallback;
EGLInternalData2()
:m_isInitialized(false),
m_windowWidth(0),
m_windowHeight(0),
m_keyboardCallback(0),
m_wheelCallback(0),
m_resizeCallback(0),
m_mouseButtonCallback(0),
m_mouseMoveCallback(0)
{
}
};
EGLOpenGLWindow::EGLOpenGLWindow()
{
m_data = new EGLInternalData2();
}
EGLOpenGLWindow::~EGLOpenGLWindow()
{
delete m_data;
}
void EGLOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
{
}
void EGLOpenGLWindow::closeWindow()
{
}
void EGLOpenGLWindow::runMainLoop()
{
}
float EGLOpenGLWindow::getTimeInSeconds()
{
return 0.;
}
bool EGLOpenGLWindow::requestedExit() const
{
return false;
}
void EGLOpenGLWindow::setRequestExit()
{
}
void EGLOpenGLWindow::startRendering()
{
}
void EGLOpenGLWindow::endRendering()
{
}
bool EGLOpenGLWindow::isModifierKeyPressed(int key)
{
return false;
}
void EGLOpenGLWindow::setMouseMoveCallback(b3MouseMoveCallback mouseCallback)
{
m_data->m_mouseMoveCallback = mouseCallback;
}
b3MouseMoveCallback EGLOpenGLWindow::getMouseMoveCallback()
{
return m_data->m_mouseMoveCallback;
}
void EGLOpenGLWindow::setMouseButtonCallback(b3MouseButtonCallback mouseCallback)
{
m_data->m_mouseButtonCallback = mouseCallback;
}
b3MouseButtonCallback EGLOpenGLWindow::getMouseButtonCallback()
{
return m_data->m_mouseButtonCallback;
}
void EGLOpenGLWindow::setResizeCallback(b3ResizeCallback resizeCallback)
{
m_data->m_resizeCallback = resizeCallback;
}
b3ResizeCallback EGLOpenGLWindow::getResizeCallback()
{
return m_data->m_resizeCallback;
}
void EGLOpenGLWindow::setWheelCallback(b3WheelCallback wheelCallback)
{
m_data->m_wheelCallback = wheelCallback;
}
b3WheelCallback EGLOpenGLWindow::getWheelCallback()
{
return m_data->m_wheelCallback;
}
void EGLOpenGLWindow::setKeyboardCallback( b3KeyboardCallback keyboardCallback)
{
m_data->m_keyboardCallback = keyboardCallback;
}
b3KeyboardCallback EGLOpenGLWindow::getKeyboardCallback()
{
return m_data->m_keyboardCallback;
}
void EGLOpenGLWindow::setRenderCallback( b3RenderCallback renderCallback)
{
}
void EGLOpenGLWindow::setWindowTitle(const char* title)
{
}
float EGLOpenGLWindow::getRetinaScale() const
{
return 1.f;
}
void EGLOpenGLWindow::setAllowRetina(bool allow)
{
}
int EGLOpenGLWindow::getWidth() const
{
return m_data->m_windowWidth;
}
int EGLOpenGLWindow::getHeight() const
{
return m_data->m_windowHeight;
}
int EGLOpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
{
return 0;
}
#endif //BT_USE_EGL