mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-06 06:53:59 +00:00
Renamed CoreGL* to GL* and merged CoreGL*Constants
This commit is contained in:
parent
038108fb76
commit
6deb142378
41 changed files with 13243 additions and 312 deletions
|
|
@ -122,14 +122,14 @@ public class PositionTest extends BasicTest {
|
|||
// =====================================================
|
||||
Sys.log("Setting up OpenGL");
|
||||
|
||||
CoreGL11.glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
CoreGL11.glMatrixMode(CoreGL11.GL_PROJECTION);
|
||||
CoreGL11.glLoadIdentity();
|
||||
GL11.glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GLU.gluPerspective(50.0, WINDOW_WIDTH / WINDOW_HEIGHT, 0.0, 50.0);
|
||||
CoreGL11.glMatrixMode(CoreGL11.GL_MODELVIEW);
|
||||
CoreGL11.glLoadIdentity();
|
||||
CoreGL11.glTranslatef(0.0f, 0.0f, -6.6f);
|
||||
CoreGL11.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0f, 0.0f, -6.6f);
|
||||
GL11.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glut = this.new GLUT();
|
||||
|
||||
Window.setVSyncEnabled(true);
|
||||
|
|
@ -404,48 +404,48 @@ public class PositionTest extends BasicTest {
|
|||
* Render the scene
|
||||
*/
|
||||
private void render() {
|
||||
CoreGL11.glClear(CoreGL11.GL_COLOR_BUFFER_BIT | CoreGL11.GL_DEPTH_BUFFER_BIT);
|
||||
CoreGL11.glPushMatrix();
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
CoreGL11.glRotatef(20.0f, 1.0f, 1.0f, 0.0f);
|
||||
GL11.glRotatef(20.0f, 1.0f, 1.0f, 0.0f);
|
||||
|
||||
// left
|
||||
CoreGL11.glPushMatrix();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
CoreGL11.glTranslatef(leftPosition.get(0), leftPosition.get(1), leftPosition.get(2));
|
||||
CoreGL11.glColor3f(1.0f, 0.0f, 0.0f);
|
||||
GL11.glTranslatef(leftPosition.get(0), leftPosition.get(1), leftPosition.get(2));
|
||||
GL11.glColor3f(1.0f, 0.0f, 0.0f);
|
||||
glut.glutWireCube(0.5f);
|
||||
}
|
||||
CoreGL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
// center
|
||||
CoreGL11.glPushMatrix();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
CoreGL11.glTranslatef(centerPosition.get(0), centerPosition.get(1), centerPosition.get(2));
|
||||
CoreGL11.glColor3f(0.0f, 0.0f, 1.0f);
|
||||
GL11.glTranslatef(centerPosition.get(0), centerPosition.get(1), centerPosition.get(2));
|
||||
GL11.glColor3f(0.0f, 0.0f, 1.0f);
|
||||
glut.glutWireCube(0.5f);
|
||||
}
|
||||
CoreGL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
// right
|
||||
CoreGL11.glPushMatrix();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
CoreGL11.glTranslatef(rightPosition.get(0), rightPosition.get(1), rightPosition.get(2));
|
||||
CoreGL11.glColor3f(0.0f, 1.0f, 0.0f);
|
||||
GL11.glTranslatef(rightPosition.get(0), rightPosition.get(1), rightPosition.get(2));
|
||||
GL11.glColor3f(0.0f, 1.0f, 0.0f);
|
||||
glut.glutWireCube(0.5f);
|
||||
}
|
||||
CoreGL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
// listener
|
||||
CoreGL11.glPushMatrix();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
CoreGL11.glTranslatef(listenerPosition.get(0), listenerPosition.get(1), listenerPosition.get(2));
|
||||
CoreGL11.glColor3f(1.0f, 1.0f, 1.0f);
|
||||
GL11.glTranslatef(listenerPosition.get(0), listenerPosition.get(1), listenerPosition.get(2));
|
||||
GL11.glColor3f(1.0f, 1.0f, 1.0f);
|
||||
glut.glutSolidCube(0.5f);
|
||||
}
|
||||
CoreGL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
CoreGL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -515,11 +515,11 @@ public class PositionTest extends BasicTest {
|
|||
float v[][] = new float[8][3];
|
||||
|
||||
public void glutWireCube(float size) {
|
||||
drawBox(size, CoreGL11.GL_LINE_LOOP);
|
||||
drawBox(size, GL11.GL_LINE_LOOP);
|
||||
}
|
||||
|
||||
public void glutSolidCube(float size) {
|
||||
drawBox(size, CoreGL11.GL_QUADS);
|
||||
drawBox(size, GL11.GL_QUADS);
|
||||
}
|
||||
|
||||
private void drawBox(float size, int type) {
|
||||
|
|
@ -532,13 +532,13 @@ public class PositionTest extends BasicTest {
|
|||
v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
|
||||
|
||||
for (int i = 5; i >= 0; i--) {
|
||||
CoreGL11.glBegin(type);
|
||||
CoreGL11.glNormal3f(n[i][0], n[i][1], n[i][2]);
|
||||
CoreGL11.glVertex3f(v[faces[i][0]][0], v[faces[i][0]][1], v[faces[i][0]][2]);
|
||||
CoreGL11.glVertex3f(v[faces[i][1]][0], v[faces[i][1]][1], v[faces[i][1]][2]);
|
||||
CoreGL11.glVertex3f(v[faces[i][2]][0], v[faces[i][2]][1], v[faces[i][2]][2]);
|
||||
CoreGL11.glVertex3f(v[faces[i][3]][0], v[faces[i][3]][1], v[faces[i][3]][2]);
|
||||
CoreGL11.glEnd();
|
||||
GL11.glBegin(type);
|
||||
GL11.glNormal3f(n[i][0], n[i][1], n[i][2]);
|
||||
GL11.glVertex3f(v[faces[i][0]][0], v[faces[i][0]][1], v[faces[i][0]][2]);
|
||||
GL11.glVertex3f(v[faces[i][1]][0], v[faces[i][1]][1], v[faces[i][1]][2]);
|
||||
GL11.glVertex3f(v[faces[i][2]][0], v[faces[i][2]][1], v[faces[i][2]][2]);
|
||||
GL11.glVertex3f(v[faces[i][3]][0], v[faces[i][3]][1], v[faces[i][3]][2]);
|
||||
GL11.glEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue