New answers tagged

2

Your best bet is to make a class that replicates Javas Graphics class in LWJGL. For textures you can write your own LWJGL wrapper or use Slick 2D


0

You should use your ShapeRenderer as an input into your draw function. // The shapeRenderer as input public void draw (ShapeRenderer renderer) { renderer.set(ShapeType.Filled); renderer.drawRect(this.xcord, this.ycord, this.width, this.height); } Taking the ShapeRenderer as input also allows you to iterate over a list of rectangles to draw your ...


2

http://chat.stackexchange.com/transcript/message/30419781#30419781 Bind more than one render target. Output two different colors from the fragment shader. You will of course need a second draw call to draw a fullscreen quad containing the render target you want to show. You can also branch every fragment on a uniform if you really want. Fairly ...


-1

Should I create a component to wrap each mesh, texture, animation class and wrap the rendering loop as a system in my framework? No, you should definitely not create a component (in the "entity-component" sense) for each of meshes, textures, animations, et cetera. What good is a texture component attached to an entity without any of the other rendering ...


3

This is a very hard question to answer since there are many things which come into account when you have to deal with these things. What I usually do, is that I set up an array for all my enemies. Each enemy is basically an object with values such as their coordinates, direction, sprites etc., and what's most important, a draw() and an update() function. ...


1

Try changing the image using setDrawable() method: loading.setDrawable(new TextureRegionDrawable(new TextureRegion(new Texture("90.png")));


0

Change the order in layer on the canvas to -1.


1

Start graphics debugging (ALT+F5) your program with visual studio directX graphics diagnostic and capture a frame, then double click on the thumbnail of frame and view your event list and your pipeline. It will help you to find out whats really happening down there. May be you forgot to set and clear your render target view before drawing vertices. read ...


0

There are several performance issues with the code sample you supplied. Consider using pop to increase performance for (; i < n; i++) { data = result[i]; vs while((data = result.pop()) != null) {... If it can't be destructive which I think looking at your code it can be then you can clone using var clone = myArray.slice(0); Performance is ...



Top 50 recent answers are included