Skip to content

Commit

Permalink
removed OpenGL ES 1.x, fixed up all the things...
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Mar 2, 2014
1 parent 08711a2 commit 38e6533
Show file tree
Hide file tree
Showing 272 changed files with 1,100 additions and 6,406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public void onCreate (Bundle savedInstanceState) {
config.useAccelerometer = false;
config.useCompass = false;
config.useWakelock = true;
config.useGL20 = true;
initialize(new Cubocy(), config);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class CubocDesktop {
public static void main (String[] argv) {
new LwjglApplication(new Cubocy(), "Cubocy", 480, 320, true);
new LwjglApplication(new Cubocy(), "Cubocy", 480, 320);

// After creating the Application instance we can set the log level to
// show the output of calls to Gdx.app.debug
Expand Down
6 changes: 3 additions & 3 deletions demos/cuboc/cuboc/src/com/badlogic/cubocy/MapRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
Expand Down Expand Up @@ -124,7 +124,7 @@ public void render (float deltaTime) {
renderLaserBeams();

cache.setProjectionMatrix(cam.combined);
Gdx.gl.glDisable(GL10.GL_BLEND);
Gdx.gl.glDisable(GL20.GL_BLEND);
cache.begin();
int b = 0;
for (int blockY = 0; blockY < 4; blockY++) {
Expand Down Expand Up @@ -226,7 +226,7 @@ private void renderLasers () {

private void renderLaserBeams () {
cam.update(false);
renderer.begin(cam.combined, GL10.GL_LINES);
renderer.begin(cam.combined, GL20.GL_LINES);
for (int i = 0; i < map.lasers.size; i++) {
Laser laser = map.lasers.get(i);
float sx = laser.startPoint.x, sy = laser.startPoint.y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
Expand All @@ -27,7 +27,7 @@ public void show () {

@Override
public void render (float delta) {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(intro, 0, 0);
batch.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;

public class GameScreen extends CubocScreen {
Map map;
Expand All @@ -30,7 +30,7 @@ public void render (float delta) {
delta = Math.min(0.06f, Gdx.graphics.getDeltaTime());
map.update(delta);
Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
renderer.render(delta);
controlRenderer.render();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
Expand All @@ -27,7 +27,7 @@ public void show () {

@Override
public void render (float delta) {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(intro, 0, 0);
batch.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
Expand All @@ -27,7 +27,7 @@ public void show () {

@Override
public void render (float delta) {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(title, 0, 0);
batch.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public void onCreate (Bundle savedInstanceState) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useWakelock = true;
config.useGL20 = true;
initialize(new GdxInvaders(), config);
}
}
25 changes: 13 additions & 12 deletions demos/invaders/gdx-invaders-html5/.classpath
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-backends-gwt"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-invaders"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-controllers"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-controllers-gwt"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-backends-gwt"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-invaders"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-controllers"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx-controllers-gwt"/>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER/GWT"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
eclipse.preferences.version=1
entryPointModules=
filesCopiedToWebInfLib=gwt-servlet.jar
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBW11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14NTEybV1dPjwvdm0tYXJncz48ZW50cnktcG9pbnQtbW9kdWxlPmNvbS5iYWRsb2dpYy5nZHhpbnZhZGVycy5HZHhJbnZhZGVyc0d3dDwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public static void main (String[] argv) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "Gdx Invaders";
config.vSyncEnabled = true;
config.useGL20 = true;
new LwjglApplication(new GdxInvaders(), config);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GLCommon;
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
Expand Down Expand Up @@ -89,10 +89,10 @@ public void render (Simulation simulation, float delta) {
// We explicitly require GL10, otherwise we could've used the GLCommon
// interface via Gdx.gl
GLCommon gl = Gdx.gl;
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
renderBackground();
gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glEnable(GL10.GL_CULL_FACE);
gl.glEnable(GL20.GL_DEPTH_TEST);
gl.glEnable(GL20.GL_CULL_FACE);
setProjectionAndCamera(simulation.ship);

modelBatch.begin(camera);
Expand All @@ -104,8 +104,8 @@ public void render (Simulation simulation, float delta) {
modelBatch.render(simulation.shots);
modelBatch.end();

gl.glDisable(GL10.GL_CULL_FACE);
gl.glDisable(GL10.GL_DEPTH_TEST);
gl.glDisable(GL20.GL_CULL_FACE);
gl.glDisable(GL20.GL_DEPTH_TEST);

spriteBatch.setProjectionMatrix(viewMatrix);
spriteBatch.begin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
Expand Down Expand Up @@ -82,7 +82,7 @@ public boolean isDone () {

@Override
public void draw (float delta) {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

viewMatrix.setToOrtho2D(0, 0, 480, 320);
spriteBatch.setProjectionMatrix(viewMatrix);
Expand All @@ -95,7 +95,7 @@ public void draw (float delta) {
spriteBatch.draw(logo, 0, 320 - 128, 480, 128, 0, 256, 512, 256, false, false);
String text = "It is the end my friend.\nTouch to continue!";
TextBounds bounds = font.getMultiLineBounds(text);
spriteBatch.setBlendFunction(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);
spriteBatch.setBlendFunction(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA);
font.drawMultiLine(spriteBatch, text, 0, 160 + bounds.height / 2, 480, HAlignment.CENTER);
spriteBatch.end();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector3;

/** The main menu screen showing a background, the logo of the game and a label telling the user to touch the screen to start the
* game. Waits for the touch and returns isDone() == true when it's done so that the ochestrating GdxInvaders class can switch to
Expand Down Expand Up @@ -83,7 +82,7 @@ public void update (float delta) {

@Override
public void draw (float delta) {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

viewMatrix.setToOrtho2D(0, 0, 480, 320);
spriteBatch.setProjectionMatrix(viewMatrix);
Expand All @@ -94,7 +93,7 @@ public void draw (float delta) {
spriteBatch.draw(background, 0, 0, 480, 320, 0, 0, 512, 512, false, false);
spriteBatch.enableBlending();
spriteBatch.draw(logo, 0, 320 - 128, 480, 128, 0, 0, 512, 256, false, false);
spriteBatch.setBlendFunction(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);
spriteBatch.setBlendFunction(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA);
String text = "Touch screen to start!";
float width = font.getBounds(text).width;
font.draw(spriteBatch, text, 240 - width / 2, 128);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.ArrayList;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
Expand Down Expand Up @@ -81,7 +81,7 @@ private void populate () {
invaderModel.materials.get(0).set(TextureAttribute.createDiffuse(invaderTexture));

((ColorAttribute)blockModel.materials.get(0).get(ColorAttribute.Diffuse)).color.set(0, 0, 1, 0.5f);
blockModel.materials.get(0).set(new BlendingAttribute(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA));
blockModel.materials.get(0).set(new BlendingAttribute(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA));

shotModel.materials.get(0).set(ColorAttribute.createDiffuse(1, 1, 0, 1f));

Expand Down Expand Up @@ -134,8 +134,8 @@ private void populate () {
explosionMesh.setVertices(vertices);
explosionMesh.setIndices(indices);

explosionModel = ModelBuilder.createFromMesh(explosionMesh, GL10.GL_TRIANGLES,
new Material(new BlendingAttribute(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA),
explosionModel = ModelBuilder.createFromMesh(explosionMesh, GL20.GL_TRIANGLES,
new Material(new BlendingAttribute(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA),
TextureAttribute.createDiffuse(explosionTexture)));

ship = new Ship(shipModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class MetagunAndroid extends AndroidApplication {
@Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initialize(new Metagun(), false);
initialize(new Metagun());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.mojang.metagun.screen.Screen;
import com.mojang.metagun.screen.TitleScreen;

Expand Down Expand Up @@ -47,7 +47,7 @@ public void setScreen (Screen newScreen) {

@Override
public void render () {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
accum += Gdx.graphics.getDeltaTime();
while (accum > 1.0f / 60.0f) {
screen.tick(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

public class MetagunDesktop {
public static void main (String[] argv) {
new LwjglApplication(new Metagun(), "Metagun", 320, 240, false);
new LwjglApplication(new Metagun(), "Metagun", 320, 240);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

public class PaxBritannicaDesktop {
public static void main(String[] args) {
new LwjglApplication(new PaxBritannica(),
"Pax Britannica", 1024, 550,false);
new LwjglApplication(new PaxBritannica(), "Pax Britannica", 1024, 550);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
Expand Down Expand Up @@ -91,7 +91,7 @@ public void show() {
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

time += delta;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package de.swagner.paxbritannica.mainmenu;

import java.io.IOException;
import java.util.ArrayList;

import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public class SuperJumperAndroid extends AndroidApplication {
@Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initialize(new SuperJumper(), false);
initialize(new SuperJumper());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package com.badlogicgames.superjumper;

import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GLCommon;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
Expand Down Expand Up @@ -192,7 +192,7 @@ private void updateGameOver () {

public void draw () {
GLCommon gl = Gdx.gl;
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

renderer.render();

Expand Down
Loading

0 comments on commit 38e6533

Please sign in to comment.