0
votes
1answer
82 views

spinning a 2d Cube

I know that a cube is actually a 3d shape , but i have some other problem over here. I have been doing 2D Game dev using libgdx but have never touched 3D rendering. Now what I want in my 2D game is ...
0
votes
1answer
64 views

Implementing Camera Zoom in a 2D Engine

I'm currently trying to implement camera scaling/zoom in my 2D Engine. Normally I calculate the Sprite's drawing size and position similar to this pseudo code: render() { var x = sprite.x; ...
12
votes
6answers
574 views

Seamless tilemap rendering (borderless adjacent images)

I have a 2D game engine that draws tilemaps by drawing tiles from a tileset image. Because by default OpenGL can only wrap the entire texture (GL_REPEAT), and not just part of it, each tile is split ...
0
votes
0answers
48 views

Rendering bug in java

I'm using a simple rendering method in java to render tiles. Everything looks fine, but I notice that some rows grow 1 pixel when I move, and dhen shrink back, but I have no idea why. Infos: I'm ...
1
vote
1answer
77 views

Why does rendering a gradiented shape leave gaps?

Sometimes when I am drawing objects that aren't 'linear' (e.g. rounded edges, circles, ellipses, diagonal lines, etc) I this weird effect of some pixels at certain points not getting drawn. It's ...
1
vote
2answers
265 views

Should game objects draw themselves? [duplicate]

Assuming you have classes like Player, Enemy, Map and Tile. The first approach to structuring rendering code would be to give each a render() method and let it draw itself: void render(){ ...
1
vote
1answer
101 views

Better way to handle ordering and visibility of renderable objects?

I'm just wondering whether there is a more effective way to handle the ordering and visibility of renderable components that fits into the design of my already existing engine. How I do it now: In ...
0
votes
0answers
246 views

Android SurfaceView framerate issue

I am using SurfaceView to draw a lot of Bitmaps onto canvas. This causes really variable frame rates depending on how many objects are present. My code below: public class OriginalView extends ...
0
votes
1answer
101 views

How to render polygons of arbitrary shape? [duplicate]

I am trying to render a plane with nodes. FYI : Nodes know what other nodes it is being attached to. I can think of a way to render them as long as they are aligned in a circular pattern; have a ...
2
votes
1answer
233 views

Issues upscaling pixel art with SampleState.PointClamp

I'm developing a 2D game, and I'm striving to create a nice blocky low-res appearance for the game, yet allow it to be played at variable resolutions. So, I've researched resolution independency and ...
1
vote
0answers
343 views

Optimal OpenGL 2D Sprite Batching (Best Practice)

I am working on simple 2D engine using OpenGL (3.3+) for rendering and was wondering what the optimal method of sprite batching would be. I plan to put all sprites into one (or fewer) texture atlases. ...
0
votes
1answer
355 views

How to scale a texture in OpenGL/LWJGL?

How would I take a texture and render it to a specific size? The texture I'm rendering has a 1:1 ratio so I want to be able to render the whole image like if the window is wide then put black outlines ...
1
vote
2answers
481 views

Tile-based game with DirectX - issues with transparency and StretchRect

In my current project I have a class which loads a map file and then it should load all associated tilesets (no transparent tiles - I used to work with magenta as a colorkey) and precreate a surface ...
2
votes
6answers
677 views

Is it good to sort objects list before every rendering?

I need to render a "tile" game, which are like these: or or I don't know how to render them in correct order. I intend to perform a sorting operator before every rendering (depending on their ...
1
vote
2answers
248 views

How do I cap rendering of tiles in a 2D game with SDL?

I have some boilerplate code working, I basically have a tile based map composed of just 3 colors, and some walls and render with SDL. The tiles are in a bmp file, but each tile inside it corresponds ...
4
votes
1answer
249 views

Is there any heuristic to polygonize a closed 2D raster shape with n triangles?

Let's say we have a 2D image black on white that shows a closed geometric shape. Is there any (not naive brute force) algorithm that approximates that shape as closely as possible with n triangles? ...
0
votes
1answer
410 views

Rendering Loop Problem (Java)

I'm not new to programming, but I am relatively new to game programming. I am trying to create a version of Breakout, as a good basic game to get myself introduced to 2d game programming. I currently ...
4
votes
2answers
2k views

Resources for 2D rendering using OpenGL? [closed]

I noticed that there is quite some difference between 3D and 2D rendering using OpenGL, the techniques are different - pixel-perfect placing is a lot more desirable, among other things. Are there any ...
2
votes
2answers
1k views

How do I draw 2D textures with Direct3D 11.1?

I'm running into trouble trying to figure out the best way to draw textures to the screen using Directx 11.1 (for Metro apps). In XNA, I used SpriteBatch. Is there something partially comperable? In ...
1
vote
1answer
288 views

How do I make light objects in XNA?

Here's my dilemma : I want to have light sources placeable by the player, in terms of lanterns. I know the best way to do this is to use pixel shaders, which I have done a lot of research and use ...
1
vote
3answers
357 views

What name (if any) applies to this particular 3D rendering technique?

Is there a name for this technique where when instead of rendering certain polygons, you just calculate a few key points and do the drawings in 2d? For instance, instead of rendering a sphere, you ...
49
votes
2answers
3k views

How can I get textures on edge of walls like in Super Metroid and Aquaria?

Games like Super Metroid and Aquaria present the terrain with the other facing parts having rocks and stuff while deeper behind them (i.e. underground) there's different detail or just black. I ...
5
votes
3answers
790 views

Game Classes design

I'm trying to create a simple 2D sprite game. The problem I'm having now is how to design my game. I was thinking of using a Sprite class that will be my base class for all the different types of ...
2
votes
3answers
1k views

Java tilemap not working, Think it has something to do with my image rendering

Hey can someone help me out, I've been trying to fix this for about 2 hours now, and I'm a noob when it comes to game programming and Java(only been reading and programming with it for a week now, ...
1
vote
1answer
754 views

LWJGL Rendering a 2D Object at a Certain Position On-Screen

Okay, so in LWJGL, how can I render a 2D object (maybe for like a menu, or meter that shows up on screen during the game), and have control over size and position on screen? So I can tell it what ...
2
votes
1answer
945 views

android zoomable and scrollable board game

I'm developing a Android board game and have a question regarding creating a board that is zoomable and scrollable. The board contains a static background, characters (players) and the actual "level" ...
4
votes
2answers
704 views

Drawing territories border in 2d map

I'm programming a little web strategy game. In the country map I pretend to display each country with a national color. The issue is how to render the borders in a simple and efficient way. Right now ...
10
votes
2answers
17k views

How Do I Do Alpha Transparency Properly In XNA 4.0?

Okay, I've read several articles, tutorials, and questions regarding this. Most point to the same technique which doesn't solve my problem. I need the ability to create semi-transparent sprites ...