1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023243: Adapt OpenGL viewer for using in Cocoa applications on Mac OS X

Cocoa_Window draft
OpenGl_Context and OpenGl_Window - added support for Cocoa OpenGL context
TKV3d - accept Cocoa_Window
Draft version of ViewerInit method for Mac OS X
Added ViewerTest_CocoaEventManagerView
ViewerTest - attach events to Cocoa window
Cocoa_Window - disable autorelease on close
Fix for OpenGl_Context::Init method
Cocoa_Window - convert top-left coordinates to bottom-left
Added selection with rubber band (rubber band drawing still should be implemented)
Fixed OpenGl_Display initialization on Mac OS X
Fixed OpenGl includes
This commit is contained in:
bugmaster
2012-12-24 17:46:07 +04:00
parent 352ffd7358
commit 4fe5661921
30 changed files with 1916 additions and 297 deletions

View File

@@ -6,6 +6,7 @@ InterfaceGraphic_Portability.hxx
InterfaceGraphic_Visual3d.hxx
InterfaceGraphic_WNT.hxx
InterfaceGraphic_X11.hxx
InterfaceGraphic_Cocoa.hxx
InterfaceGraphic_XWD.hxx
InterfaceGraphic_wntio.hxx
InterfaceGraphic_cPrintf.cxx

View File

@@ -17,12 +17,14 @@
// and conditions governing the rights and limitations under the License.
#ifndef __INTERFACE_GRAPHIC_HXX
# define __INTERFACE_GRAPHIC_HXX
#define __INTERFACE_GRAPHIC_HXX
#ifdef WNT
# include <InterfaceGraphic_WNT.hxx>
#include <InterfaceGraphic_WNT.hxx>
#elif defined(__APPLE__)
#include <InterfaceGraphic_Cocoa.hxx>
#else
# include <InterfaceGraphic_X11.hxx>
#endif //WNT
#include <InterfaceGraphic_X11.hxx>
#endif
#endif /* __INTERFACE_GRAPHIC_HXX */
#endif // __INTERFACE_GRAPHIC_HXX

View File

@@ -0,0 +1,40 @@
// Copyright (c) 2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifdef __APPLE__
#ifndef InterfaceGraphic_CocoaHeader
#define InterfaceGraphic_CocoaHeader
#include <stdio.h>
#define WINDOW void*
#define DISPLAY void*
#define GLCONTEXT void*
#define GLDRAWABLE void*
#define GET_GL_CONTEXT() NULL
#define GET_GLDEV_CONTEXT() NULL
#define GL_MAKE_CURRENT(a,b,c) {}
#ifndef EXPORT
#define EXPORT
#endif
#endif InterfaceGraphic_CocoaHeader
#endif // __APPLE__