FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing/java/libraries/glw/src/processing/glw/GLW.java at master · biddy/processing · GitHub
biddy
processing
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
processing
/
java
/
libraries
/
glw
/
src
/
processing
/
glw
/
GLW.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (40 loc) · 1.35 KB
Breadcrumbs
processing
/
java
/
libraries
/
glw
/
src
/
processing
/
glw
/
GLW.java
Copy path
File metadata and controls
52 lines (40 loc) · 1.35 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package
processing
.
glw
;
import
processing
.
core
.
PGraphics
;
import
com
.
jogamp
.
newt
.
opengl
.
GLWindow
;
import
java
.
util
.
HashMap
;
public
class
GLW
{
static
public
final
String
RENDERER
=
"processing.glw.PGraphicsGLW"
;
static
public
final
String
OPENGL
=
"processing.glw.PGraphicsGLW"
;
static
public
final
String
P2D
=
"processing.glw.PGraphics2D"
;
static
public
final
String
P3D
=
"processing.glw.PGraphics3D"
;
static
protected
HashMap
<
PGraphics
,
GLWindow
>
windows
=
new
HashMap
<
PGraphics
,
GLWindow
>();
public
GLW
() {
}
static
public
void
createWindow
(
PGraphics
pg
) {
if
(
pg
instanceof
PGraphics2D
||
pg
instanceof
PGraphics3D
) {
windows
.
put
(
pg
,
null
);
}
else
{
throw
new
RuntimeException
(
"Only GLW.P2D or GLW.P3D surfaces can be attached to a window"
);
}
}
static
public
GLWindow
getWindow
(
PGraphics
pg
) {
return
windows
.
get
(
pg
);
}
static
public
boolean
isFocused
(
PGraphics
pg
) {
GLWindow
win
=
windows
.
get
(
pg
);
return
win
!=
null
&&
win
.
hasFocus
();
}
static
public
PGraphics
getFocusedGraphics
() {
for
(
PGraphics
pg
:
windows
.
keySet
()) {
if
(
isFocused
(
pg
))
return
pg
;
}
return
null
;
}
static
public
GLWindow
getFocusedWindow
() {
for
(
PGraphics
pg
:
windows
.
keySet
()) {
if
(
isFocused
(
pg
))
return
windows
.
get
(
pg
);
}
return
null
;
}
}
Back
|
FazBrowse Home
|
New Git URL