0023226: Extend OpenGl_Context to store map of shared GPU resources
[occt.git] / src / Aspect / Aspect_GraphicCallbackProc.hxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
7 //
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 //
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
17
18 #ifndef _Aspect_GraphicCallbackProc_HeaderFile
19 #define _Aspect_GraphicCallbackProc_HeaderFile
20
21 #include <Aspect_Display.hxx>
22 #include <Aspect_Drawable.hxx>
23 #include <Aspect_RenderingContext.hxx>
24 #include <Handle_Standard_Transient.hxx>
25
26 // The flags below provide additional information to define the moment when
27 // callback was invoked in redraw procedure. These flags are bitwise OR'ed
28 // with the "reason" value of callback:
29 // 1) OCC_PRE_REDRAW  - callback was invoked before redrawing underlayer
30 //                      ( at the beginning of redraw procedure );
31 // 2) OCC_PRE_OVERLAY - callback was invoked before redrawing overlayer;
32 // Otherwise, if no flags added to the "reason" value, the callback was
33 // invoked at the end of redraw ( after the overlayer is redrawn )
34 #define OCC_PRE_REDRAW  0x4000
35 #define OCC_PRE_OVERLAY 0x8000
36
37 // mask for all additional callbacks that invoked in process of redrawing
38 #define OCC_REDRAW_ADDITIONAL_CALLBACKS ( OCC_PRE_REDRAW | OCC_PRE_OVERLAY )
39
40 typedef struct
41 {
42   int reason;
43   int wsID;
44   int viewID;
45   Handle(Standard_Transient) glContext;
46 } Aspect_GraphicCallbackStruct;
47
48 // Prototype for callback function to perform custom drawing within the same window and GL context.
49 typedef int (*Aspect_GraphicCallbackProc) (Aspect_Drawable               theWindowID,
50                                            void*                         theUserData,
51                                            Aspect_GraphicCallbackStruct* theCallData);
52
53 class Handle(Standard_Type);
54 const Handle(Standard_Type)& STANDARD_TYPE(Aspect_GraphicCallbackProc);
55
56 #endif /* _Aspect_GraphicCallbackProc_HeaderFile */