1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox OpenGL Cocoa Window System Helper definition
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | * additional information or have any questions.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef __renderspu_cocoa_helper_h
|
---|
23 | #define __renderspu_cocoa_helper_h
|
---|
24 |
|
---|
25 | #ifdef __OBJC__
|
---|
26 | # import <Cocoa/Cocoa.h>
|
---|
27 | typedef NSView *NativeViewRef;
|
---|
28 | typedef NSOpenGLContext *NativeGLCtxRef;
|
---|
29 | #else /* __OBJC__ */
|
---|
30 | typedef void *NativeViewRef;
|
---|
31 | typedef void *NativeGLCtxRef;
|
---|
32 | #endif /* __OBJC__ */
|
---|
33 |
|
---|
34 | #include <iprt/cdefs.h>
|
---|
35 | #include <OpenGl/OpenGl.h>
|
---|
36 |
|
---|
37 | RT_C_DECLS_BEGIN
|
---|
38 |
|
---|
39 | /* OpenGL context management */
|
---|
40 | void cocoaGLCtxCreate(NativeGLCtxRef *ppCtx, GLbitfield fVisParams);
|
---|
41 | void cocoaGLCtxDestroy(NativeGLCtxRef pCtx);
|
---|
42 |
|
---|
43 | /* View management */
|
---|
44 | void cocoaViewCreate(NativeViewRef *ppView, NativeViewRef pParentView, GLbitfield fVisParams);
|
---|
45 | void cocoaViewDestroy(NativeViewRef pView);
|
---|
46 | void cocoaViewDisplay(NativeViewRef pView);
|
---|
47 | void cocoaViewShow(NativeViewRef pView, GLboolean fShowIt);
|
---|
48 | void cocoaViewSetPosition(NativeViewRef pView, NativeViewRef pParentView, int x, int y);
|
---|
49 | void cocoaViewSetSize(NativeViewRef pView, int w, int h);
|
---|
50 | void cocoaViewGetGeometry(NativeViewRef pView, int *pX, int *pY, int *pW, int *pH);
|
---|
51 |
|
---|
52 | void cocoaViewMakeCurrentContext(NativeViewRef pView, NativeGLCtxRef pCtx);
|
---|
53 | void cocoaViewSetVisibleRegion(NativeViewRef pView, GLint cRects, GLint* paRects);
|
---|
54 |
|
---|
55 | /* OpenGL wrapper */
|
---|
56 | void cocoaFlush();
|
---|
57 | void cocoaFinish();
|
---|
58 | void cocoaBindFramebufferEXT(GLenum target, GLuint framebuffer);
|
---|
59 |
|
---|
60 | RT_C_DECLS_END
|
---|
61 |
|
---|
62 | #endif /* __renderspu_cocoa_helper_h */
|
---|
63 |
|
---|