Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit cc5977e

Browse files
committed
load example.html again
1 parent e231753 commit cc5977e

File tree

4 files changed

+53
-34
lines changed

4 files changed

+53
-34
lines changed

example/lwjgl3-opengl/src/main/java/com/labymedia/ultralight/lwjgl3/opengl/drawing/OpenGLDrawer.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ public class OpenGLDrawer {
3131
* Draw a rotating triangle.
3232
*/
3333
public void draw() {
34-
// glDisable(GL_DEPTH_TEST);
35-
// glEnable(GL_ALPHA_TEST);
36-
// glUseProgram(0);
37-
// glPushMatrix();
38-
// rotation += 0.01;
39-
// glRotatef(rotation, 0, 0, 1);
40-
// glBegin(GL_TRIANGLES);
41-
//
42-
//
43-
// glColor3f(1.0f, 0.0f, 0.0f);
44-
// glVertex2f(-1.0f, -1.0f);
45-
//
46-
// glColor3f(0.0f, 1.0f, 0.0f);
47-
// glVertex2f(1.0f, -1.0f);
48-
//
49-
// glColor3f(0.0f, 0.0f, 1.0f);
50-
// glVertex2f(0.0f, 1.0f);
51-
//
52-
// glEnd();
53-
// glPopMatrix();
34+
glDisable(GL_DEPTH_TEST);
35+
glEnable(GL_ALPHA_TEST);
36+
glUseProgram(0);
37+
glPushMatrix();
38+
rotation += 0.01;
39+
glRotatef(rotation, 0, 0, 1);
40+
glBegin(GL_TRIANGLES);
41+
42+
43+
glColor3f(1.0f, 0.0f, 0.0f);
44+
glVertex2f(-1.0f, -1.0f);
45+
46+
glColor3f(0.0f, 1.0f, 0.0f);
47+
glVertex2f(1.0f, -1.0f);
48+
49+
glColor3f(0.0f, 0.0f, 1.0f);
50+
glVertex2f(0.0f, 1.0f);
51+
52+
glEnd();
53+
glPopMatrix();
5454
}
5555
}

example/lwjgl3-opengl/src/main/java/com/labymedia/ultralight/lwjgl3/opengl/support/WebController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void render() {
173173
float[] uv = this.view.renderTarget().uv_coords;
174174
int width = (int) view.width();
175175
int height = (int) view.height();
176-
glClearColor(1,1,1,1);
176+
glClearColor(0,0,0,1);
177177
glEnable(GL_TEXTURE_2D);
178178
// Set up the OpenGL state for rendering of a fullscreen quad
179179
glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_TRANSFORM_BIT);

example/lwjgl3-opengl/src/main/resources/example.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
<!--
33
Ultralight Java - Java wrapper for the Ultralight web engine
44
Copyright (C) 2020 - 2021 LabyMedia and contributors
5-
65
This program is free software; you can redistribute it and/or
76
modify it under the terms of the GNU Lesser General Public
87
License as published by the Free Software Foundation; either
98
version 3 of the License, or (at your option) any later version.
10-
119
This program is distributed in the hope that it will be useful,
1210
but WITHOUT ANY WARRANTY; without even the implied warranty of
1311
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1412
Lesser General Public License for more details.
15-
1613
You should have received a copy of the GNU Lesser General Public License
1714
along with this program; if not, write to the Free Software Foundation,
1815
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -25,7 +22,8 @@
2522
</head>
2623
<body> <!-- Transparent background for demo purposes -->
2724
<div id="center">
28-
<span>Hello, World!</span>
25+
<span>Hello, World!</span>
2926
</div>
27+
<script src="example.js"></script>
3028
</body>
3129
</html>

example/lwjgl3-opengl/src/main/resources/style.css

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,34 @@
1717
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818
*/
1919

20-
body{
21-
background: #f06;
22-
background: linear-gradient(45deg, #fff722, #ff26f9),linear-gradient(142deg, transparent, white),linear-gradient(108deg, red, transparent);
23-
min-height: 100%;
24-
width:100vh;
25-
height:100vh;
26-
position:relative;
27-
z-index:1;
28-
overflow: hidden;
20+
html, body {
21+
background: transparent;
22+
}
23+
24+
#center {
25+
position: absolute;
26+
width: 400px;
27+
height: 100px;
28+
29+
margin: auto;
30+
31+
background: rgba(0, 0, 0, 0.2);
32+
33+
top: 0;
34+
left: 0;
35+
bottom: 0;
36+
right: 0;
37+
38+
border-radius: 10px;
39+
}
40+
41+
#center > span {
42+
text-align: center;
43+
vertical-align: middle;
44+
line-height: 100px;
45+
46+
color: white;
47+
font-size: 40px;
48+
49+
width: 400px;
2950
}

0 commit comments

Comments
 (0)