Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.h
41159 views
1
/*
2
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
#ifndef CGLGraphicsConfig_h_Included
27
#define CGLGraphicsConfig_h_Included
28
29
#import "jni.h"
30
#import "J2D_GL/gl.h"
31
#import "OGLSurfaceData.h"
32
#import "OGLContext.h"
33
#import <Cocoa/Cocoa.h>
34
35
// REMIND: Using an NSOpenGLPixelBuffer as the scratch surface has been
36
// problematic thus far (seeing garbage and flickering when switching
37
// between an NSView and the scratch surface), so the following enables
38
// an alternate codepath that uses a hidden NSWindow/NSView as the scratch
39
// surface, for the purposes of making a context current in certain
40
// situations. It appears that calling [NSOpenGLContext setView] too
41
// frequently contributes to the bad behavior, so we should try to avoid
42
// switching to the scratch surface whenever possible.
43
44
/* Do we need this if we are using all off-screen drawing ? */
45
#define USE_NSVIEW_FOR_SCRATCH 1
46
47
/**
48
* The CGLGraphicsConfigInfo structure contains information specific to a
49
* given CGLGraphicsConfig.
50
*
51
* OGLContext *context;
52
* The context associated with this CGLGraphicsConfig.
53
*/
54
typedef struct _CGLGraphicsConfigInfo {
55
OGLContext *context;
56
} CGLGraphicsConfigInfo;
57
58
/**
59
* The CGLCtxInfo structure contains the native CGLContext information
60
* required by and is encapsulated by the platform-independent OGLContext
61
* structure.
62
*
63
* NSOpenGLContext *context;
64
* The core native NSOpenGL context. Rendering commands have no effect until
65
* a context is made current (active).
66
*
67
* NSOpenGLPixelBuffer *scratchSurface;
68
* The scratch surface id used to make a context current when we do
69
* not otherwise have a reference to an OpenGL surface for the purposes of
70
* making a context current.
71
*/
72
typedef struct _CGLCtxInfo {
73
NSOpenGLContext *context;
74
#if USE_NSVIEW_FOR_SCRATCH
75
NSView *scratchSurface;
76
#else
77
NSOpenGLPixelBuffer *scratchSurface;
78
#endif
79
} CGLCtxInfo;
80
81
#endif /* CGLGraphicsConfig_h_Included */
82
83