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

learn more… | top users | synonyms

0
votes
1answer
57 views

Handling player and AI in a component based structure dynamically?

I'm trying to find a way to allow both input and AI to call actions of an actor in a component based structure. The actions make use of the components. To keep the system flexible I don't want to ...
-2
votes
0answers
46 views

What does it take to give 1080p support in games? [on hold]

So I have been reading about HD remakes how texture resolutions are upped/touched up and have other qualities such as AA applied, models can can increased poly count. I also read however that a game ...
-1
votes
4answers
130 views

Why use compression such as zlib?

Compression and encryption are different things AFAIK, so why even use compression if you have to still decompress anyway, is this just to reduce distribution size or is there some other reason?
-1
votes
0answers
21 views

changing the color of gl_quads inside loop

I am trying to make a chess board with black and with quads , it should display black and whiote alternate quards but its not doing that for some reason here is my code #include <glut.h> void ...
0
votes
1answer
58 views

Simple shader for sprite interface [on hold]

I have been looking for any examples for a long time, I cant get anything to work (from the examples). I have tried using vertex/pixel shaders, effects files, but they never have any effect on the ...
0
votes
1answer
81 views

Ambient occlusion: Correct culling after anisotropy correction

I've added simple color based ambient occlusion to my game. First it looked like this (from giawa.com): The description: "Due to anisotropy, the ambient occlusion shading on the top left is ...
-1
votes
0answers
37 views

World of Tanks Mods [on hold]

Ok, let me just get straight to it. How do I create a World of Tanks Moderation? I understand that this may be off-topic, but this was the closest Exchange I could for creating a World of Tanks Mods. ...
0
votes
0answers
58 views

How do you manage object pools in your engine/game? [closed]

I would like to know how do you manage object pools in your engines/games and how do you access them. I have some ideas: For each entity manually add a static member that will be the ObjectPool ...
3
votes
1answer
67 views

OpenGL - Drawing multiple meshes at once using VBOs and IBOs

I have been learning OpenGL 2.1 but using shaders, VBOs, IBOs, etc. I have gotten a rendering engine that can load and draw meshes, materials, forward lighting (no shadows yet), SceneNodes, and ...
0
votes
0answers
25 views

Comparing type's in C++ [migrated]

I'm working on a custom engine where I have 2 different transform classes, one for 2D and one for 3D. I'm using a #define to choose which transform class to use and using that definition instead of ...
1
vote
1answer
68 views

OpenGL - Texture disappears

I'm making a simple program with C++, SDL and GLEW. So far it is going great but I ran into a weird problem. One of my four textures would not show up on screen even though it used the same code as ...
-1
votes
0answers
47 views

PathFinding algorithm for RTS Game [closed]

I am developing the IA part of a RTS game and I need to make a pathfinding algorithm, to avoid obstacles and collision with the water and rocks. I have the map of tiles of the game and a black and ...
1
vote
1answer
103 views

Simple framerate counter?

I'm making a first person shooter, and I've seen questions like this before, but the answer is either overly complicated or they're using SDL, GLFW, GLUT, or something else. I'm not using any of that. ...
3
votes
1answer
90 views

glm direction vector rotation

I'm working on a flight simulator, but I'm stuck with my airplane orientation. I tried some things but noone worked correctly. This is what I have : To be able to move it and roll it around himself, ...
0
votes
1answer
32 views

accelerated curved bounce

I'm trying to make a simple pong clone and want the ball to curve when the racket was moving on hit. To test out curves I removed all the rackets and just have a ball bouncing around in a rectangle, ...
0
votes
0answers
53 views

Error while loading PNG file with SDL2

I have been building a small game using SDL2 and C++ and started getting a weird error when trying to load a PNG. The error reads: libpng warning: Out of memory libpng error: IDAT: insufficient ...
1
vote
0answers
62 views

How to rotate enemies on 2D radar and clip them to circle shape? [duplicate]

I've been working on implementing a 2D radar for a 3D game lately, it's working fine in a very basic version. This is what is looks like: It works by transforming the 3D coordinates of the enemies ...
0
votes
2answers
151 views

What does “~” in front of a function name inside a class mean? [closed]

I added a class using the 'add class' item in Visual Studio Express and it generated two functions in the .cpp file with the same names. But the second has the ~ character in front of it. What does ...
0
votes
1answer
84 views

Rendering multiple meshes in directx11

Recently I have tried adding rendering with multiple meshes in my program. This did not go too well. The attempt I currently have goes like this bd.Usage = D3D11_USAGE_DEFAULT; bd.ByteWidth = ...
-1
votes
1answer
77 views

How to encode game files or pack to one file like game_data.dat [duplicate]

I am a beginner C++ programmer. I am creating a custom Open Tibia Server and I use the alternative Tibia client (OTClient). I want encode game files (image, sound, lua, etc.) or pack all files into ...
0
votes
2answers
58 views

Disable lighting in DirectX10

I'm implementing a D3D10 version of my renderer (not porting to avoid losing Windows XP support). I didn't go straight to D3D11 because MSDN and other sources recommend upgrading to 10 and then to 11. ...
0
votes
1answer
43 views

Playing a sprite sheet animation in Cocos2D-x

I'm trying to create an animation using a sprite sheet in Cocos2D-x. I'm doing the following. The game doesn't crash but the screen is still blank. bool HelloWorld::init() { ...
0
votes
1answer
38 views

Computing Field-of-View from window dimensions

I'm looking into computing the vertical Field-of-View (FOVy) based on the projection parameters of my camera. From this source, I've found an equation that seems to work. float ...
3
votes
2answers
85 views

How to detect Lagoons and Lakes on a random Island Map

I have an engine which generates random Islands. At the moment it tends to generate quite a lot of lagoons and lakes. I would like to know of a feasible way of detecting them so that I can mark them ...
0
votes
0answers
13 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
72 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
vote
2answers
194 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 ...
0
votes
2answers
197 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?
1
vote
1answer
42 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 ...
2
votes
1answer
155 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
114 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
56 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
52 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 ...
0
votes
1answer
40 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
206 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
129 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
344 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
86 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
72 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
170 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 ...
2
votes
0answers
33 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
23 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
93 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
122 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
61 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
62 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
1answer
75 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
33 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 ...