Skip to main content

All Questions

Tagged with
74 questions with no upvoted or accepted answers
4 votes
1 answer
3k views

2D pixel-perfect collision detection with opengl

I'm writing a 2D, sprite-based game and I'm having a hard time with making collision detection. First of all, I am well aware of other methods and in fact I'm using Box2D's quadtree queries to filter ...
user2357520's user avatar
3 votes
0 answers
3k views

OpenGL dashed line

I'm trying to draw a 2d grid in opengl which contains dashed lines. I'm using glEnble(GL_LINE_STIPPLE) / glLineStipple(...) to do so. The problem is when I'm trying to drag the scene, dashes begin to ...
Mikhail  Zimka's user avatar
3 votes
0 answers
139 views

LWJGL Inventory Rendering Wrong

So ive been working on a 2D rpg game and ive worked out the inventory quite nicely but ive ran into a problem where when I have an item in a slot the slot directly after it doesnt render; its just a ...
Kuliu's user avatar
  • 171
3 votes
1 answer
3k views

2d shadow mapping

I have been wondering about how to implement this with openGL: I have a map, with a flat floor and walls. Every thing here is 2d, there is no 3d geometry, only 2d poligons that compose the map. Using ...
Leo's user avatar
  • 1,244
2 votes
1 answer
199 views

How to improve a look of a 2d light?

I'd like to have a nice light. I am not sure how exactly should I call it, but you'll see when I actually show some example. What I mean by nice is like this scene: It looks like light has some ...
BrodaJarek3's user avatar
2 votes
0 answers
225 views

How can I switch between 2 shaders without adding more and more draw calls?

I would like to create a renderer class that can switch between 2 or more shaders without adding more and more draw calls. What I mean is to have 2 shaders - A and B - and method that takes shader, ...
user avatar
2 votes
0 answers
105 views

2D semi-diagonal pixel offsetting

I'm writing a fully 2d game (top-down using a 2/1 isometric viewpoint using OpenGL with an orthographic projection) in which entities often move semi-diagonally (e.g. northeast: 2 pixels to the right ...
Edwin Skeevers's user avatar
2 votes
1 answer
481 views

OpenGL 2D collision detection isn't working

I have a 2D OpenGL game which I am trying to implement aabb collision detection in. Here is the collision detection code: boolean collisionX = position.x + size.x + dx >= collision.position.x &...
Dylan Deshler's user avatar
2 votes
1 answer
3k views

OpenGL Rendering 2D in a 3D space

Am currently working on a project as part of my coursework and realised I needed to have a HUD to display information to the user, stumbled upon glOrtho and have been trying to use it however am ...
Cosmin S's user avatar
2 votes
0 answers
302 views

Slick2D Alpha Lighting Issues

I'm writing an Alpha Map Lighting system, and I've been successful to some degree. Here is my code: g.clearAlphaMap(); g.setDrawMode(Graphics.MODE_ALPHA_MAP); GL11.glEnable(SGL.GL_BLEND); GL11....
Quinn Finney's user avatar
2 votes
2 answers
311 views

Depth sorting of elements drawn on the screen

I have small program here in which I am drawing some elements on the window. class CustomPointer{ void draw(); //draw png image on the screen }; class CustomRectangle{ void draw(){ drawRect(); //...
Cipher's user avatar
  • 6,052
2 votes
2 answers
2k views

Alternative to glRotatef and glutBitmapCharacter?

This is what my code is currently. However, for the life of me I cannot get the text to rotate. Do I need to use something other than glutBitmapCharacter? Just to clarify, this is only a 2D program ...
Ankit Ahuja's user avatar
2 votes
3 answers
5k views

OpenGL: Drawing objects (fixed size, indifferent to zoom, and relative position) on a map

I am working on a Java OpenGL application described below. The application shows a large 2D texture of a world map. Some information must be represented as captions on the map (for example, a caption ...
txedo's user avatar
  • 976
1 vote
0 answers
174 views

Access violation 0xc0000005 rendering multiple objects

Recently I have been toying with open-gl eventually I decided to give it a shot and write my very own straightforward 2d-game engine myself, unfortunately for some reason when attempting to render ...
Maciej21592's user avatar
1 vote
0 answers
361 views

How do I animate 2d legs in OpenGL to swing back and forth? C++

I have a programming assignment that one portion is swinging the legs back and forth in order to create a walking motion. To me this is what should logically work. It should be 20 steps, each loop ...
Cecilia T.'s user avatar

15 30 50 per page
1
2 3 4 5