qsdwfegrhtjyukil;
parent
de06575654
commit
046d92a87a
|
@ -50,7 +50,6 @@ public class Litecraft extends Game
|
|||
this.setupWindow();
|
||||
Blocks.setup(); // make sure blocks are initialised
|
||||
GingerUtils.init(); // set up ginger utilities
|
||||
Window.setBackgroundColour(0.2f, 0.2f, 0.6f); // set the window refresh colour
|
||||
// set up Ginger3D stuff
|
||||
this.setupGinger();
|
||||
this.oldWindowWidth = Window.width;
|
||||
|
|
|
@ -122,7 +122,7 @@ public class Ginger
|
|||
while (!Window.closed())
|
||||
{
|
||||
Litecraft.getInstance().ups++;
|
||||
if (Window.isUpdating())
|
||||
if (Window.shouldRender())
|
||||
{
|
||||
timer.tick();
|
||||
gingerRegister.game.render();
|
||||
|
|
|
@ -18,7 +18,7 @@ public class Window
|
|||
public static int height;
|
||||
private static String title;
|
||||
public static long window;
|
||||
private static Vector3f backgroundColour = new Vector3f(0.2f, 0.2f, 0.2f);
|
||||
private static Vector3f backgroundColour = new Vector3f(118f, 215f, 234f);
|
||||
private static boolean[] mouseButtons = new boolean[GLFW.GLFW_MOUSE_BUTTON_LAST];
|
||||
private static GLFWImage.Buffer iconBuffer = null;
|
||||
private static double fpsCap, time, processedTime = 0;
|
||||
|
@ -127,7 +127,7 @@ public class Window
|
|||
public static boolean isMouseReleased(int keyCode)
|
||||
{ return !isMouseDown(keyCode) && mouseButtons[keyCode]; }
|
||||
|
||||
public static boolean isUpdating()
|
||||
public static boolean shouldRender()
|
||||
{
|
||||
double nextTime = getTime();
|
||||
double passedTime = nextTime - time;
|
||||
|
@ -144,9 +144,6 @@ public class Window
|
|||
public static void lockMouse()
|
||||
{ GLFW.glfwSetInputMode(window, GLFW.GLFW_CURSOR, GLFW.GLFW_CURSOR_DISABLED); }
|
||||
|
||||
public static void setBackgroundColour(float r, float g, float b)
|
||||
{ backgroundColour = new Vector3f(r, g, b); }
|
||||
|
||||
private static void setIcon()
|
||||
{
|
||||
Image icon = Image.createImage("/icon.png");
|
||||
|
@ -180,7 +177,7 @@ public class Window
|
|||
width = widthBuffer.get(0);
|
||||
height = heightBuffer.get(0);
|
||||
GL11.glViewport(0, 0, width, height);
|
||||
GL11.glClearColor(backgroundColour.x, backgroundColour.y, backgroundColour.z, 1.0f);
|
||||
GL11.glClearColor(backgroundColour.x/255, backgroundColour.y/255, backgroundColour.z/255, 1.0f);
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
GLFW.glfwPollEvents();
|
||||
newX = Window.getMouseX();
|
||||
|
|
|
@ -20,8 +20,8 @@ const vec4 plane = vec4(0, -1, 0, 15);
|
|||
|
||||
uniform float useFakeLighting;
|
||||
|
||||
const float density = 0.025;
|
||||
const float gradient = 1.0;
|
||||
const float density = 0.0025;
|
||||
const float gradient = 10.0;
|
||||
|
||||
void main(void){
|
||||
|
||||
|
|
Loading…
Reference in New Issue