3
votes
1answer
59 views

Should my GLSL Shader object/wrapper encapsulate loading/setting a VertexArrayObject?

I am working on a 2D game in C++, with a simple rendering layer over OpenGL. I have a wrapper for GLSL shaders and shader programs, these wrappers encapsulate shader objects into C++ classes and ...
1
vote
2answers
162 views

How to reduce/remove graphical artifacts?

Question I'm working on a side-scrolling game that has a 2D grid for rendering to the screen. I'm using OpenGL, and I've optimized my game so that nothing invisible is attempted to be drawn. As of ...
-1
votes
1answer
38 views

Combine textures with coordinates [closed]

Is it possible to add one texture to another texture, at specific coordinates? Like if I want to add a small texture(16x16) to big texture (1368 x 768) with coordinates ( 100, 100) so the small ...
0
votes
1answer
91 views

How to use FrameBuffer objects (OpenGL)

I want to draw a 2D scene and after the scene i want to draw some light effects. When i draw some light, i create a FBO, draw in it and when finished with drawing, i want to create a texture where i ...
0
votes
2answers
153 views

How can I regulate update and event frequency?

I'm trying to create a small 2D RPG-type engine using C++, SDL/OpenGL and Tiled. My little demo looks very similar to a Pokemon or Zelda game. I was curious how to go about regulating FPS and how ...
0
votes
0answers
159 views

2D Sidescroller camera

I'm using OpenGL. For my tiles, I'm using a display list and I'm just using immediate more for my player (for now). When I move the player, I want to center him in the center of the window, but allow ...
2
votes
0answers
186 views

Help with 2D sprite instancing [closed]

Alright, so I'm pretty new to OpenGL programming. I've been writing my own engine, initially using the fixed function pipeline. I then did a 1:1 replacement of the fixed-function methods with shaders ...
-1
votes
1answer
82 views

Problem in animating polygon [closed]

Hi I am trying to move my black colored polygon downward. But As soon as I run my application my polygon gets invisible! I think My logic of move function is wrong. Can anyone help me out in figuring ...
5
votes
1answer
2k views

How to use modern OpenGL for 2D games?

I've found a plethora of "modern" OpenGL (3.0+) tutorials for 3D, but I have found next to nothing when looking for information on how to use it for 2D game development. How can I get started using ...
2
votes
2answers
442 views

OpenGL - drawElements 2D imposible z-sorting (textured)

I am creating a 2D program in OpenGL 3.2 Now to render what I do is have a VBO for each texture and add the elements of the objects that use that texture to this vbo. Now as you know the order you ...
3
votes
1answer
268 views

OpenGL - Z- Buffer translucency

So lately I wanted to use the Z buffer in opengl to order my 2D sprites in my program. Now I didn;t relaize that if you use the Z buffer then you cant blend these sprites. And some of these sprites ...
0
votes
0answers
235 views

How do I use Opengl in conjunction with SDL?

I've been using SDL for a while in simple 2D games but have been limited as to what I can do graphics wise. I would like to start using Opengl. Does anyone know of any web tutorials for using Opengl ...
3
votes
1answer
213 views

what's the best way of panning in a 2D scene

Up to know I have used this functions to create a 2D scene (for showing images) and to pan on it ( in fact it's a customization of the class COpenGLControl here in codeguru) : void ...
1
vote
1answer
99 views

How to render models using a personalized projection matrix?

I'm creating a game with a great sprite demand. Out team is considering automatizing the sprite generation using 3D models. The problem is we have a very particular ortographic projection: We have ...
2
votes
2answers
291 views

Split up a screen into regions

My task: I want to split up a screen into 3 regions for buffs-bar (with picked items), score-info and a game-map. It doesn't matter are regions intersect with each other or not. For example: I have ...
22
votes
6answers
2k views

Is OpenGL appropriate for 2D games?

I have been teaching myself the OpenGL library for a while now, and want to start making a game. However, for an easier introduction, I want to start with something 2D, such as a top down ...
3
votes
1answer
310 views

The most efficent ways for drawing lines all day long with OpenGL

I'd like to put a computer screen that is running an OpenGL programs in a room. It has to run all day long (not in the night). I'd like to draw lines that are slowly fading in the background. The ...
6
votes
3answers
2k views

How do I implement occluded lighting in a block-based 2D game?

I want to have 2D lighting that can be blocked by in-game objects. My game has a top-down view and all game objects are described by rectangles. Let's say I have a 10x10 world and I place a light at ...
1
vote
1answer
100 views

2D Platform character getting “unaligned” with the map

I'm trying to make a 2D Platform game and so far I can have my character moving around in a tiled map and collisions are working too. So far so good. The problem I'm having is that the character can ...
0
votes
1answer
628 views

How can I implement infinite scrolling by scrolling the background's texture, not the quad? [duplicate]

I'm writing a 2D platformer game on Java with LWJGL. I'm doing this just for the sake of learning and not the result itself, so when I decided to implement scrolling I did it two ways I could invent ...
4
votes
2answers
384 views

OpenGL: Filtering/antialising textures in a 2D game

I'm working on a 2D game using OpenGL 1.5 that uses rather large textures. I'm seeing aliasing effects and am wondering how to tackle those. I'm finding lots of material about antialiasing in 3D ...
3
votes
2answers
2k views

2D water shader similar to Limbo's effect

I'm wondering how I would go about creating a 2D water shader that is seen in this video http://www.youtube.com/watch?v=phChFfi4GOs The water effect that limbo uses is pretty awesome. I'm not so ...
1
vote
0answers
305 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. ...
3
votes
1answer
429 views

Proper way to maintain Vertex Buffer Objects

I've started learning WebGL, currently I'm building a 2D lighting system, but there is some confusion going on inside my head. How the lighting works is based on this tutorial ...
4
votes
1answer
287 views

How do you display non-cutout transparent 2D textures with a depth buffer? (OpenGL)

I've been able to get my 2D renderer to display transparent cutout textures by testing the alpha of a fragment and discarding if it is less than 1 (or any fraction really). The problem is I want to ...
2
votes
2answers
577 views

Does my 2D OpenGL renderer need optimized?

I've started a game engine for learning purposes. I have successfully gotten an opengl renderer working and I can draw textures of varying sizes to the screen. The way I have done this is by creating ...
0
votes
2answers
716 views

Drawing Sprites in Android OpenGL efficiently?

I want to basically give myself some sprite drawing functions (making use of openGL) such as; draw(Texture,x,y) I want to do this using OpenGL-ES 2.0 on Android. Since the textures can be varying ...
0
votes
1answer
291 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 ...
3
votes
1answer
273 views

How to do perspective projection “parallax” but without changing the scale or offset of objects?

Hello everyone I have this problem that I have tried everything I could think of. The problem: I am making a 2D game with parallax effect but I am using 3d space so am not simulating the parallax but ...
4
votes
1answer
504 views

Batching dynamic sprites in OpenGL

I'm trying to wrap my head around how batching is done in a 2D sprite-based game. My understanding is I'd get the vertices that represent each sprite I want to draw and stuff them all into a single ...
8
votes
1answer
671 views

Rendering 8 bit graphics

I have a strong programming background just not from game development. I only made some pong and snake in high school and I did some OpenGL in college. I want to make my own game engine. Nothing ...
0
votes
1answer
117 views

enemy behavior with boundary to change direction

I'm doing space shooter kind of game, the logic is to reflect the enemy if it hits the boundary. With my logic, sometimes enemy behaves like flickering instead of changing the velocity. It's like ...
1
vote
2answers
1k views

Rotating 2D Object

Well I am trying to learn openGL and want to make a triangle move one unit (0.1) everytime I press one of the keyboard arrows. However i want the triangle to turn first pointing the direction where i ...
2
votes
1answer
459 views

Rendering multiple squares fast?

so I'm doing my first steps with openGL development on android and I'm kinda stuck at some serious performance issues... What I'm trying to do is render a whole grid of single colored squares on to ...
10
votes
2answers
1k views

What should I worry about when changing OpenGL origin to upper left of screen?

For self education, I'm writing a 2D platformer engine in C++ using SDL / OpenGL. I initially began with pure SDL using the tutorials on sdltutorials.com and lazyfoo.net, but I'm now using SDL to ...
4
votes
2answers
1k views

OpenGL Lighting [duplicate]

I have a simple day and night cycle by at day disabling OpenGL lighting and at night enabling openGL Lighting. When I enable everything appears darker. My question is How would I make it that at a ...
2
votes
1answer
562 views

OpenGL: Move camera regardless of rotation

For a 2D board game I'd like to move and rotate an orthogonal camera in coordinates given in a reference system (window space), but simply can't get it to work. The idea is that the user can drag the ...
1
vote
2answers
1k views

OpenGL ES high-quality 2D scaling

Let's say I'm making a 2D game and I want to implement a zoom in/out feature. Normally this is as simple as modifying the projection matrix to get more or less of the world to show. However, this ...
0
votes
2answers
933 views

How to draw lines between user draggable points?

I want to create a triangle using three different points on the SurfaceView using OpenGL. Line indications between the points with one color and fill the triangle with different color. I want to pull ...
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 ...
0
votes
0answers
130 views

Is there a standard way to track 2d tile positions both locally and on screen?

I'm building a 2D engine based on 32x32 tiles with OpenGL. OpenGL draws from the top left, so Y coordinates go down the screen as they increase. Obviously this is different than a standard graph ...
0
votes
1answer
1k views

Texture displays on Android emulator but not on device

I have written a simple UI which takes an image (256x256) and maps it to a rectangle. This works perfectly on the emulator however on the phone the texture does not show, I see only a white ...
0
votes
1answer
959 views

How to implement HUD

I'm wondering how one could implement an HUD in LWJGL. I've seen tutorials on this, but they don't seem to work. I know the basic structure goes like this: init3d(); // 3d code init2d(); // HUD To ...
1
vote
1answer
724 views

How can I add a parallax effect into my side-scrolling game? [duplicate]

How can I add a parallax effect into my side-scrolling game? I read a lot about parallax scrolling so I know what the logic is and what parallax is but I can't create a dynamic parallax effect. I ...
0
votes
1answer
764 views

How to make a 2D Terrain with opengl?

I want to make a simple 2d terrain with just a few bumps and height changes: I thought about just using random numbers to describe the height of a certain vertex, but I don't see how I can make ...
0
votes
0answers
56 views

OpenGL 2D Depth Perception [duplicate]

Possible Duplicate: OpenGL 2D Depth Perception I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth ...
0
votes
3answers
595 views

OpenGL 2D Depth Perception

I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth perception is. So , for example, if the player goes in ...
4
votes
2answers
4k views

Basics of drawing in 2d with OpenGL 3 shaders

I am new to OpenGL 3 and graphics programming, and want to create some basic 2d graphics. I have the following scenario of how I might go about drawing a basic (but general) 2d rectangle. I'm not ...
3
votes
3answers
393 views

The ship “shudders” in scrolling Asteroids

In my Asteroids game the user can scroll through space. When scrolling, the ship is drawn in the centre of the window. I use interpolation. I scroll the window uing glOrtho, centering it around the ...
3
votes
3answers
994 views

OpenGL & SDL textures… game shuts down

I'm going to create a game in C++ with SDL & openGL but adding textures won't work. the code is in some different classes. here's the main file ...