mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-31 06:30:52 +00:00
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@499 b9cfdab3-6d41-4d17-bbe4-086880011989
66 lines
1.1 KiB
C
66 lines
1.1 KiB
C
/* $Id$ */
|
|
/*!
|
|
* @file Mw/Widget/OpenGL.h
|
|
* @brief OpenGL widget
|
|
*/
|
|
#ifndef __MW_WIDGET_OPENGL_H__
|
|
#define __MW_WIDGET_OPENGL_H__
|
|
|
|
#include <Mw/MachDep.h>
|
|
#include <Mw/TypeDefs.h>
|
|
#include <Mw/Core.h>
|
|
|
|
#ifdef _WIN32
|
|
#include <windows.h>
|
|
#else
|
|
#include <GL/glx.h>
|
|
#endif
|
|
#include <GL/gl.h>
|
|
|
|
#ifndef GLAPIENTRY
|
|
#define GLAPIENTRY APIENTRY
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*!
|
|
* @brief OpenGL widget class
|
|
*/
|
|
MWDECL MwClass MwOpenGLClass;
|
|
|
|
/*!
|
|
* @brief Make a widget current OpenGL context
|
|
* @param handle Widget
|
|
*/
|
|
MwInline void MwOpenGLMakeCurrent(MwWidget handle) {
|
|
MwVaWidgetExecute(handle, "mwOpenGLMakeCurrent", NULL);
|
|
};
|
|
|
|
/*!
|
|
* @brief Get a procedure from OpenGL
|
|
* @param handle Widget
|
|
* @param name Name
|
|
* @return Procedure
|
|
*/
|
|
MwInline void* MwOpenGLGetProcAddress(MwWidget handle, const char* name) {
|
|
void* out;
|
|
MwVaWidgetExecute(handle, "mwOpenGLGetProcAddress", &out, name);
|
|
return out;
|
|
};
|
|
|
|
/*!
|
|
* @brief Swaps the buffer of OpenGL context
|
|
* @param handle Widget
|
|
*/
|
|
MwInline void MwOpenGLSwapBuffer(MwWidget handle) {
|
|
MwVaWidgetExecute(handle, "mwOpenGLSwapBuffer", NULL);
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|