Skip to content

Instantly share code, notes, and snippets.

@bootstraponline
bootstraponline / APIUtil.java
Created April 30, 2012 17:38
LWJGL Error - sizeNew
// sizeNew is never used.
private static char[] getArray(final int size) {
char[] array = arrayTL.get();
if ( array.length < size ) {
int sizeNew = array.length << 1;
while ( sizeNew < size )
sizeNew <<= 1;
array = new char[size];
@bootstraponline
bootstraponline / Test.java
Created April 28, 2012 17:15
LWJGL / PlayN Test
// Code inserted into GLDemo.java (playn-gldemo-core)
final int[] tex = new int[16];
gl.glGetIntegerv(GL20.GL_MAX_TEXTURE_SIZE, tex, 0);
System.out.println(tex[0]);
// Code from JavaGL20.java (playn-java)
@Override
public void glGetIntegerv(int pname, int[] params, int offset) {
final int length = params.length - offset;
resizeIntBuffer(length);
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above