public InputVisualizer() { eventBuffer = new RingBuffer<MouseEvent>(MAX_EVENTS); eventPool = new ReflectionPool<MouseEvent>(MouseEvent.class); shader = new ShaderProgram( Gdx.files.internal("assets/shaders/visualizer.vert"), Gdx.files.internal("assets/shaders/visualizer.frag")); if (!shader.isCompiled()) { Gdx.app.log("InputVisualizer", shader.getLog()); } evBufferLoc = shader.getUniformLocation("u_mouseEvs[0]"); projMatrixLoc = shader.getUniformLocation("u_projTrans"); if (evBufferLoc == -1) { Gdx.app.log("InputVisualizer", "No uniform with name u_mouseEvents found in shader"); } mesh = new Mesh(false, 4, 4, VertexAttribute.Position()); addListener(new MouseListener()); }
public void free (Object object) { if (object == null) { throw new IllegalArgumentException("object cannot be null."); } ReflectionPool pool = pools.get(object.getClass()); if (pool == null) { return; // Ignore freeing an object that was never retained. } pool.free(object); }
public void free(Object object) { if (object == null) { throw new IllegalArgumentException("object cannot be null."); } ReflectionPool pool = pools.get(object.getClass()); if (pool == null) { return; // Ignore freeing an object that was never retained. } pool.free(object); }
public InputStateTracker(InputRecorder inputRecorder) { this.recorder = inputRecorder; int toSet = 0; if (recorder.getConfiguration().recordButtons) { toSet |= InputProperty.SyncProperty.Type.BUTTONS.key; } if (recorder.getConfiguration().recordOrientation) { toSet |= InputProperty.SyncProperty.Type.ORIENTATION.key; } if (recorder.getConfiguration().recordKeysPressed) { toSet |= InputProperty.SyncProperty.Type.KEYS_PRESSED.key; } if (recorder.getConfiguration().recordPointers) { toSet |= InputProperty.SyncProperty.Type.POINTERS.key; } beforePrcessEventsTrackFlags = toSet; toSet = 0; if (recorder.getConfiguration().recordKeyEvents) { toSet |= InputProperty.SyncProperty.Type.KEY_EVENTS.key; } if (recorder.getConfiguration().recordPointerEvents) { toSet |= InputProperty.SyncProperty.Type.POINTER_EVENTS.key; } onProcessEventsTrackFlags = toSet; storedStates = new ArrayList<InputState>(); processedStates = new ArrayList<InputState>(); statePool = new ReflectionPool<InputState>(InputState.class, 50); processor = new Processor(); tracker = new Tracker(); grabber = new InputEventGrabber(); grabberArmer = new GrabberArmer(); grabberKeeper = new GrabberKeeper(); }
public void free(D object) { if (object == null) { throw new IllegalArgumentException("object cannot be null."); } ReflectionPool pool = pools.get((Class<D>) object.getClass()); if (pool == null) { return; // Ignore freeing an object that was never retained. } pool.free(object); }
public ComponentPools (int initialSize, int maxSize) { this.pools = new ObjectMap<Class<?>, ReflectionPool>(); this.initialSize = initialSize; this.maxSize = maxSize; }
public ComponentPools(int initialSize, int maxSize) { this.pools = new ObjectMap<Class<?>, ReflectionPool>(); this.initialSize = 0; this.maxSize = 0; }
public DataPools(int initialSize, int maxSize) { this.pools = new ObjectMap<Class<D>, ReflectionPool>(); this.initialSize = 0; this.maxSize = 0; }