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

learn more… | top users | synonyms

-1
votes
0answers
10 views

How do I implement and structure a component based approach for game objects

So I am fairly new to game design (I made this ) and very new to coding in c++, and am attempting to make a game with c++ and SFML. Right now I have a very simple game, where a rectangle jumps around ...
0
votes
0answers
12 views

How can I animate a sprite in cocos2d-x 2.2.1 c++? [duplicate]

Is there a way to do an animation without a .plist file? I'm having a hard time doing swap animation with sprites. For example, doing an animation while the user is not doing touches and the other ...
2
votes
1answer
67 views

Informing objects within a particular state of the world state

Following the State pattern, every state in my game is a derived object that reflects a particular segment of the game (MenuState, PlayingState, GameOverState, etc.) Each of those state objects holds ...
-1
votes
0answers
44 views

Object not texturing properly [on hold]

So I am trying to texture a cube, however things aren't quite turning out as planned. The results always look similar to this: Where in this picture the texture is supposed to be a red/black ...
1
vote
1answer
115 views

Entity Component System Coupling

Lately I've been working on a small personal project which is basically an Entity Component System framework with autoupdated Systems. While I have a pretty good idea on the way the framework should ...
-1
votes
0answers
35 views

2D MMO Engine/Library? [on hold]

I was wondering if anyone knew any good libraries, frameworks, snippets of code, or engines that could make MMO networking easier or make 2D MMO games? I've been trying for a few weeks now with C++ ...
0
votes
2answers
166 views

Is it possible to use C++ with Unity instead of C#?

The title kind of says it all. Is it possible to replace C# with C++ on a game using Unity?
0
votes
0answers
12 views

Error In SFML Audio [on hold]

This is my code: #include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> int main() { sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!"); ...
-1
votes
0answers
62 views

c++ gamedev beginning signals [on hold]

So I've been working on learning c++ for Game Development and had a question about the language. I have learned a little bit about Actionscript 3 and how it uses signals to process events. I was ...
1
vote
1answer
39 views

Compute billboard rotation

I'm trying to compute a matrix to have object always facing the camera. For the moment, my result look pretty good, the problem is that my original billboard scale isn't preserved (Every billboard ...
0
votes
0answers
46 views

Which way would a character face if he is moving one way, but pointing his gun a different way? [on hold]

So I am creating a 2D platform game in C++ with SFML, in which the character wields a 2 handed grenade launcher type of gun. The character is controlled with they keyboard (arrow keys or WASD), and ...
2
votes
1answer
137 views

Anti-Aliasing in OpenGL [C++]

I'm trying to make anti-aliasing work inside of OpenGL, here's what I've tried: glEnable(GL_POINT_SMOOTH); glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); glEnable(GL_LINE_SMOOTH); ...
1
vote
1answer
99 views

C++: Checking if an object faces a point (within a certain range)

I have been working on a shooter game in C++, and am trying to add a feature whereby missiles shot must be within 90 degrees (PI/2 radians) of the direction the ship is facing. The missiles will be ...
0
votes
1answer
47 views

Proper way to encapsulate a Shader into different modules

I am planning to build a Shader system which can be accessed through different components/modules in C++. Each component has its own functionality like transform-relevated stuff (handle the MVP ...
0
votes
0answers
49 views

C++ OpenGL trouble trapping cursor in window

I am using OpenGL and I try to trap my cursor inside my game window (using both SetCursorPos and ClipCursor) But, these conflict with my camera rotation code as my camera is rotated with ...
0
votes
0answers
8 views

Create a kind of Interface c++ [migrated]

I'm writing a little 2d rendering framework with managers for input and resources like textures and meshes (for 2d geometry models, like quads) and they are all contained in a class "engine" that ...
-3
votes
0answers
41 views

Can any one name a good 3d c++ framework for game development? [closed]

I am thinking of developing a game as c++. Is there any good 3d c++ framework for it.
-1
votes
0answers
52 views

C++ Game Development [closed]

I want to make games.For now simple 2D games, but I don't know from where TO START. I "know" C++, but i havent worked with classes.I want to begin with GAME development and I searched in the internet ...
0
votes
1answer
39 views

speed up the update of glutidle()

I have a client that sends data at 1KHz (i.e. 0.001 sec) to a master over Internet using UDP protocol. In Master, I need to draw an object, but the problem is that the update of GLUT is slower than ...
7
votes
2answers
186 views

How do I find the closest points(thereby forming a polygon) enclosing a particular point?(see image)

I am working with a game engine, and my task is to add code for simulating fracture of rigid meshes. Right now I'm only working on breaking a cube. I am using Voronoi's algorithm to make a ...
3
votes
1answer
114 views

How do I render from one render target to another?

I have two render targets: a fake backbuffer; a special render target where I do all my rendering. a light render target; where I render my light fx. I'm sure I'm rendering correctly on both. The ...
10
votes
1answer
287 views

How are entity systems cache-efficient?

Lately I've been doing a lot of reading on entity systems to implement in my game engine (C++/OpenGL). The two key benefits that I constantly hear lauded about entity systems are 1) the easy ...
1
vote
2answers
79 views

OOP Question for Team System

I'm not quite sure right how I should create my "Team System". Lets say I have 2 teams with 4 players in there. The teams are Team Blue and Team Red. A team knows the amount of its members, the amount ...
-1
votes
1answer
71 views

Smooth radial collision

I'm trying to make collisions smoother in my game. Currently, entities will stop completely when they collide with an obstacle. I saw the following article recently: ...
1
vote
2answers
152 views

How to detect graphics API at runtime with SDL2?

Using SDL2, is there a way to determine at runtime whether the application is using OpenGL, OpenGLES, or DirectX? EDIT: If there is a way to figure it out without using the SDL2 API, I'm willing to ...
-5
votes
1answer
73 views

Slot machine effect on c++ [closed]

Am making some slot machine game in c++ and sfml for fun. Wanna have an idea to make the REEL effect wheen spin button is pressed.
2
votes
0answers
31 views

How to raycast against a physx cloth mesh?

I'm using the PhysX 3.3 SDK in a application and mostly everything is working fine. However, I'm trying to develop a feature that would allow users to click on various actors in the scene and modify ...
0
votes
0answers
19 views

How do I update a static mesh in Unreal 4 during movement?

I would like to use UE4 for rendering of a huge world. During the runtime, I would like to load a mesh from a custom source and adopt the mesh in the game. Could someone give me a hint how to do this ...
-3
votes
1answer
72 views

Rotate camera with mouse? [closed]

Once again, using tutorial 10 at NeHe. I want the code if (keys[VK_RIGHT]) // Is The Right Arrow Being Pressed? { yrot -= 1.5f; // Rotate The ...
1
vote
1answer
113 views

Game development for high-school with C++ and OpenGL [closed]

I've been teaching high-school students (12th grade) game programming in the last 2 years. The way I did this till now, was first to give them "half made" classes (for Point, Polygon, etc.) and ...
0
votes
2answers
55 views

Why can't I load an image with a relative path in SDL2 on Linux?

When loading a texture in SDL2 the general procedure is this: SDL_Texture* texture = IMG_LoadTexture(renderer, "resources/images/image.png); However this doesn't work and I have to supply the WHOLE ...
0
votes
1answer
36 views

Algorithm for texture blending modification

Im currently writing a terrain editor for my game (for the record: no commercial intentions) and after having implemented the terrain morphing to my liking im now working on the texturing of said ...
0
votes
0answers
7 views

OOP Design Player and AI Controlled Unit. dynamic_cast? [migrated]

Lets say I have a Actor, which can be any placeable object on my Level. I also have Unit which which is a child class of Actor. A Unit can be either a player or a AI controlled hero. And Unit also ...
0
votes
1answer
64 views

C++ OpenGL / SDL2 VBO — Depth problem / Transparency

I got a problem with my VBO. When having textures. The far blocks overlay the near ones. I tried editing the alpha, depth buffer, the VBO byte allocation. Nothing works for me... The FAR plane is ...
0
votes
0answers
32 views

How to run C++ functions from other files [duplicate]

I want to set up my game engine I'm making to essentially load C++ code from another file, and to load initialization variables from those files also. I was thinking a system that has files that store ...
0
votes
0answers
44 views

How does character creation work in 2D games? [duplicate]

My question is how does character creation work in (multiplayer) 2D game? For example player wants to have long yellow hair, black armor and white leggings. What should I do? Already have all ...
1
vote
1answer
63 views

How to implement camera pan like in Maya?

I am trying to implement camera pan like the one in Maya. I've got it almost working. The problem is that the mouse cursor is moving faster than the 3d mesh (in fact I am moving the camera but I ...
1
vote
1answer
64 views

Geometry Shader only creates one primitive

I am currently trying to use the geometry shader. My input is a set of points, for which multiple triangle should be created This is the geometry shader #version 330 layout(points) in; ...
1
vote
0answers
71 views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
0
votes
1answer
52 views

post on Facebook from cocos2d-x on windows phone

Is it possible to share/post on Facebook from cocos2d-x on windows phone. Is there any example/tutorial available.
0
votes
1answer
80 views

Surface creation algorithm using points cloud

I am looking for a realtime algorithm to create a 2D mesh using points. But I am quite confused. It seems that Delaunay triangulation can help me create mesh using point clouds, but Meta-balls seems ...
2
votes
1answer
108 views

Emscripten code and three.js

I would like, if it's possible, to use Emscripten code generated from C/C++ with the Javascript library three.js. For example, from emscripten code I want to pass rendering information to the three.js ...
1
vote
2answers
99 views

What torque should I apply in Bullet to maintain a vertical orientation?

I have a RigidBody in Bullet. Each frame, I want to apply torque to correct its orientation toward an upright position (i.e. near-zero pitch and roll). I know its angular velocity and orientation. ...
0
votes
1answer
42 views

What's the most efficient way to deal with in-game messages in Allegro 5?

I have a little 2D game made with Allegro, and I want to introduce strings during gameplay. For example, I've just made it so a key is needed to open a door, so I'd need some tutorial text to appear ...
1
vote
1answer
73 views

Henry Hatsworth kind of blocks minigame, std::vector sorting or alternative?

I'm not sure if this is the right place to post this, or if I'm doing it right. But I believe I've kept to the rules. If not, please let me know and I'll remove my post or edit it accordingly. I'm ...
0
votes
0answers
108 views

Procedural Tilemap generation

So i'm building a 2d game but i have never really done any procedural generation i followed the SFML tutorial for tilemaps and i have the maps loading what i know want to know is how can i convert the ...
0
votes
1answer
30 views

Mesa: Howto enable OpenGL 3.x functionality via extensions?

How can I enable OpenGL 3.x functionality via extensions? I'm new to OpenGL development under Linux. Currently I have #define GL_GLEXT_PROTOTYPES #include <GL/osmesa.h> #include ...
0
votes
2answers
42 views

Suggestions on audio layer and entity system

i need some suggestions on the following, i have a basic entity system in place, i need now to put some audio in the game, i would like to make a "Database" like kind of class, that would watch over ...
0
votes
2answers
152 views

UDP Netcode Architecture for Fighting Game

I am programming a fighting game that uses a UDP client/server architecture for multiplayer. The server can handle multiple clients, two of which (or one being the server) are playing and the rest are ...
0
votes
1answer
94 views

How to prevent a circular dependency between an entity and its state? [closed]

I've read this question, and I think it has some good answers and discussion, but it appears to focus primarily on rendering. I have a different problem in the management of a game entity's state. ...