Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

Filter by
Sorted by
Tagged with
-1
votes
2answers
2k views

Unity 3D vs openGL [closed]

i'm interrested in starting to learn abit about graphics programming through game development and i'm wondering what the pros/cons are when using Unity 3D over using something like C++ & openGL
20
votes
6answers
1k views

Finding direction of travel in a world with wrapped edges

I need to find the shortest distance direction from one point in my 2D world to another point where the edges are wrapped (like asteroids etc). I know how to find the shortest distance but am ...
11
votes
2answers
3k views

Removing delay at start of a key press

I'm making a simple game, and one of the problems I encountered is the annoying delay when pressing a key continuously. So basically, when I press (for a very long time) for example Up, my object ...
8
votes
1answer
1k views

Bringing a Box2D, Physics Enabled game Online? [duplicate]

Lets say, to simplify the problem of online games a bit, my goal would be to run a near identical simulation on multiple computers in sync. Would sending commands be a good idea? Now if only sending ...
8
votes
1answer
470 views

How can I copy or back-calculate definitions for an entire b2World?

I'm working on a platformer where I'd like to be able to move or copy bodies between multiple Box2D b2Worlds. The desire has cropped up three times now - moving objects between documents in my editor, ...
8
votes
1answer
996 views

How can I implement a renderer that can draw many kinds of primitives?

This is somewhat linked to a question I previously asked concerning the drawing of indexed primitives. My problem was that I was only drawing one cube when I wanted to draw many. I was told that the ...
7
votes
4answers
2k views

Where to start the coding of online leaderboards?

I NEVER, EVER did ANY sort of network code in C++, I don't know even the libraries that exist, but a popular demand for my game is online leaderboards... So, what sort of libraries I should research ...
7
votes
1answer
1k views

Spaceship interiors: How to approach, implementation-wise?

I'm creating a 3D space game using Ogre3D for graphics with C++ and one of the features is to be able to freely wander around spaceship interiors, but I am lost with how to implement it. Here is what ...
7
votes
2answers
4k views

How can I get the texture file name for my polygon?

I have a problem with the FBX SDK. I read in the data for the vertex position and the UV coordinates. It works fine, but now I want to read for each polygon to which texture it belongs, so that I can ...
6
votes
1answer
1k views

How to generate portal zones?

I'm developing a portal-based scene manager. Basically all it does is to check the portals against the camera frustum, and render their associated portal zones accordingly. Is there any way my editor ...
5
votes
3answers
932 views

How to skip the sky in lighting shaders?

I recently implemented a sky in my deferred rendered game. It is a procedurally calculated sphere with a texture applied to it. Unfortunately all lighting shaders (light sources, ambient occlusion) ...
5
votes
4answers
2k views

Inheritance Hierarchy and Design — avoiding multiple inheritance

I am working on a 3D game, and need some advice about how to best design and structure my code so that I achieve what I'm going for without using bad practices like multiple inheritance. Basically ...
4
votes
2answers
2k views

Writing a custom model file format

I am using Ogre for my rendering engine, and I planned on just using the .mesh format that is setup by default with Ogre. However, I recently purchased a large number of 3d assets from a company, only ...
4
votes
1answer
1k views

OpenGL FBO not being drawn to

In my project I'm trying to implement a deferred rendering system, problem is, I can't seem to get a second FBO to work. UPDATE 1 Here is the FBO initialization code: ...
3
votes
1answer
2k views

Handling variable frame rate in SDL2

i am creating a game with C++ and SDL2 game engine but i noticed this. I used the Vsync option for rendering, so it'll render at 60fps. If i use this game with another monitor, fps are different (for ...
3
votes
2answers
5k views

My Ambient lighting is not working correctly

I'm having a problem when using ambient lights in my opengl game. When I first started with my program, i had a positioned light, and the code was this: ...
3
votes
3answers
2k views

How do you stop OgreBullet Capsule from falling over?

I've just started implementing bullet into my Ogre project. I followed the install instructions here: http://www.ogre3d.org/tikiwiki/OgreBullet+Tutorial+1 And the rest if the tutorial here: http://...
3
votes
1answer
2k views

Creating Input layouts for different vertex types

I'm still in the planning phase for a hobby abstract renderer, and i'm wondering how i should handle multiple vertex types and different shader inputs. (This is my first graphics project, so cut me ...
2
votes
1answer
1k views

FBX SDK Colors problem

I've imported control points, normals, and indices successfully and now i'm trying to import vertex colors, but something is not right. Here's the code: ...
2
votes
2answers
437 views

FPS drop when detecting collision (sfml, c++)

So, I have this small class with a collision detection function in it, it's called every frame. When I run the game I get around 8000 FPS, but when the collision function gets called it drops to 2000....
2
votes
3answers
811 views

How to get `Label::createWithTTF` to support RTL languages such as Arabic

Firstly, I'm using Cocos2d-x v3.6, Visual Studio 2013 uses(UTF-8 without signature option) and ...
2
votes
1answer
3k views

Entity component system, Communication between components [duplicate]

I am trying to implement ECS for my simple 2D game. I would like to ask a question about how components should communicate between themselves and with entity. I tried to implement few components, ...
2
votes
1answer
20k views

Rotating an object in OpenGL about it's centre

Im writing a game for which, one of the models are loaded from an .obj file. It's a model of a plane, and I want to rotate the propeller. The object file is broken ...
2
votes
2answers
857 views

Getting around limitations posed by float in space game

I'm working on a procedurally generated game set in outer space. As in the real world, the game universe will be pretty much 99% empty, with planets/stars/solar systems etc... being very far apart. ...
2
votes
1answer
1k views

GLFW window freezes on title bar hold/drag

I am making a C++ program with Opengl and GLFW for window and input handling. The program is updated with the main loop by delta time which is calculated by subtracting new frame start time with old ...
2
votes
4answers
694 views

How to order points on a 3D grid such that we can connect them in a line loop correctly

I want to recreate an effect as close as possible to X-Com: Enemy Unkown's movement range feedback: (source: gameinformer.com) The blue line delimits the tiles which the soldier can reach using a ...
2
votes
1answer
587 views

Generated Perlin noise is not coherent (sharp edges) [closed]

I'm having a bit of trouble implementing Perlin Noise, I've included an example the problem below. I've tried debugging but everything appears to be working correctly, and I can't figure out what's ...
2
votes
5answers
1k views

OpenGL Performance Questions

This subject, as with any optimisation problem, gets hit on a lot, but I just couldn't find what I (think) I want. A lot of tutorials, and even SO questions have similar tips; generally covering: ...
1
vote
1answer
1k views

How can I avoid jittery motion in SDL2?

I am experiencing stutter when I am moving faster than 0.1 units in my program. When doing exactly 0.1 units I get: For test purposes I've made the bot always heading southeast. ...
1
vote
2answers
296 views

Cursor position to a 3D ray using angles

I've been stuck for a month trying to get gluUnProject working. After my attempts to use gluUnProject failed (as well as attempts to implement gluUnProject functionality manually) I implemented method ...
1
vote
1answer
4k views

How to use traditional pixel coordinates system in OpenGL? (with C++/SDL2)

I find the normalized, centralized coordinate system used in OpenGL weird and annoying, is there anything I can do at all to make it work like normal pixel coordinates on everything ever except OpenGL?...
0
votes
1answer
4k views

Interactions between game objects

I'm programming a basic Pacman clone to teach myself game programming. However, I'm struggling with the best way to have the game objects communicate/interact without my code becoming a huge mess. ...
0
votes
1answer
4k views

implementing collision detection and handling for tiled 2D world with smooth wall sliding

Im using SFML 2.1 for graphics and my game structure follows SFML book quite closely (SceneGraph implementation etc) My world consists mostly of characters (around 1-400, moving around) and tiles (...
9
votes
3answers
13k views

Does Windows 8 still support DirectX 9?

Is Windows 8 supporting DirectX 9? Because I was looking through some samples written in C++ and DirectX 9 made for Windows 8. It wasn't that, like I know it ( look here http://directxtutorial.com/...
6
votes
3answers
759 views

Rectangles render with gaps in between them (Box2D)

Right now I create my boxes where 1 meter is 85 pixels. Gravity is 10. And ...
6
votes
3answers
6k views

Can I develop a game using C++ and deploy to XBOX 360?

I'm a C# developer and an enthusiast of XNA, but I'm really disappointed with the game engines available for XNA. I was using Torque X, which is really good, but GarageGames no longer supports ...
4
votes
2answers
2k views

Mapping a C++ struct to an HLSL cbuffer

Out of curiosity (and peace of the mind...) I wondered how DirectX decides which attribute from a struct corresponds to the right variable inside an HLSL cbuffer-...
4
votes
2answers
5k views

Variables in static library are never initialized. Why? [closed]

I have a bunch of variables that should be initialized then my game launches, but must of them are never initialized. Here is an example of the code: MyClass.h ...
4
votes
3answers
981 views

How can I tile Perlin noise to more accurately represent a world map?

I'm currently working on my game. I would like to generate the world map with Perlin noise, and wrap it just like a real world map. I've found a algorithm to create a map wrapped along X and Y axis: ...
4
votes
4answers
1k views

C++ game-programming; What would be the “next step”?

I'm reading C++ Primer Plus 5th Edition. I'm over at Chapter 8 exercises, which is more than half of the book to go but I was wondering what would be the "next step" after I'm through with the book? ...
4
votes
1answer
894 views

Communication between objects in games?

I want to make a simple game where I have some characters fighting on a plane (level). I find the trickiest part as figuring out who should do what here. I want my terrain to have friction (so you ...
3
votes
2answers
580 views

Defining and selecting an area from an image

I want to create a game, where the world is loaded from an image file, much like Paradox Interactive does it for their games. If I have this image: Then the red, green, blue, cyan, magenta, white, ...
3
votes
2answers
108 views

Need the co-ordinates of innerPolygon

Let say I have this diagram, Given that i have all the co-ordinates of outer polygon and the distance between inner and outer polygon is d is also given. How to calculate the inner polygon co-...
3
votes
1answer
6k views

Triangle-Triangle Intersection Code

Does anyone have experience implementing this triangle-triangle intersection code that I found online? I don't understand it. I made a post on Stack Overflow about this and got the advice that: ...
3
votes
1answer
539 views

D3D9 Effects- variable parameters

I've created some simple Phong shading code from a sample. The issue is that the sample only handles one light. If I wanted a variable number of lights set at the start of each frame, how could I ...
3
votes
3answers
6k views

Circle-Rectangle collision resolution

I have a non axis aligned rectangle, like a car, in my game. I have to check and resolve the collision between the rectangle and circle, which is stationary. I have found lots of ways to determine ...
3
votes
1answer
1k views

Implement Negascout Algorithm with stack

I'm not familiar with how these stack exchange accounts work so if this is double posting I apologize. I asked the same thing on stackoverflow. I have added an AI routine to a game I am working on ...
3
votes
2answers
2k views

Supporting Controllers on Mac

I'm currently developing a small, cross-platform game for Windows/OSX. I have XInput support working correctly on the Windows version. I've left off Mac controller support until now and I'm struggling ...
3
votes
1answer
499 views

C++ A Star Algorithm [path takes wrong route] using <deque> & unique_ptr

I am having issues, trying to get my A Star algorithm working, the main problem is with my process of the algorithm, I am using something known as the TL engine which has some of its own datatypes and ...

1 3 4 5 6 7