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

learn more… | top users | synonyms

1
vote
0answers
12 views

Rearranging array for memory efficiency

This is a question about a passage from this article: I suggest having every game object exist within a single giant array. This keeps game objects together in memory, and even though deletion ...
0
votes
0answers
1 views

CocoStudio + cocos2dx 3.2 correct way to import animation?

After many frustrating hours I came to the conclusion that there is no valid way to implement a cocostudio animation, as CCArmature is deprecated and didnt work for me anyway. CocoStudio.h and ...
2
votes
3answers
190 views

“CVar system” - are CVar always looked up or cached?

Many famous game such as Quake or Half-Life use CVars to allow easy and flexible game parameter manipulations. You can simply open up the console and write something like sv_cheats 1 to enable ...
0
votes
2answers
60 views

c++ OpenGL framerate question

I am writing a simple 3D pacman using c++ and OpenGL. I'm new in OpenGL development, I wanted to make a small project before learning next concepts. For now I can't have more than 55fps when ...
0
votes
1answer
60 views

Fire Delay Timers

I currently have a turret that can fire projectiles. I can control the delay between shots (fireDelay), and I can control the time needed to reload the magazine of the gun(reloadDelay). I do the ...
1
vote
1answer
75 views

GLSL to Cg: why is the effect different?

With reference to this question, where I was trying to make the shader compile, I am now trying to make an effect appear. The effect can be shown here, through a GLSL shader: But when I use the ...
-7
votes
0answers
75 views

Using C++ on video games? [on hold]

I know the best game programming language is C++ but some game engines don't support C++ (like Unity3D). So my question is: how can I use C++ on my games? I've been learning C++ since 3 months
0
votes
1answer
58 views

filling the empty spaces in a certain region in a grid using c++

Hi guys i am struggling to find the optimal way to fill the grid of a certain region. In the above example lets say my player is at (7,5) and traveled (2,0) and i have the information of all the ...
-1
votes
0answers
26 views

How to get 3D objects using Visual C++ | OpenGL | SDL | Blender [on hold]

How to get 3D objects using Visual C++ | OpenGL | SDL | Blender Hi, I have been searching for a tutorial(s) witch corresponds or my specific desire but I had no luck, any suggestions? Thanks.
0
votes
2answers
40 views

Nearest neighbor search in 2D to find circles that interacts with point

I need to store big number of object that every object have range, then I need to find objects that the point are in their range. So basically I need to store circles and then check who interacts with ...
2
votes
0answers
93 views

Lua Implementation

I'm struggling to get Lua implemented into my game engine. I've read dozens of blogs and articles revolving around how to wrap C++ classes and I seem to have hit a wall. No matter how I structure the ...
0
votes
0answers
25 views

lodepng “undefined reference” (MinGW)?

I'm trying to use the library lodepng (lodev.org) in a C++ project. The actual library is a header and a C++ source file so the error I'm getting is confusing me. When I try reference a function or ...
0
votes
1answer
19 views

Box2D `ApplyLinearImpulse` is not working whereas `SetLinearVelocity` works

I need to mimic jumping behavior for the player in my game. Player consists of two fixtures with circle and rectangle shapes. Rectangle I use to detect ground and it is a sensor. Is some point for ...
-2
votes
0answers
34 views

Having problems with collision response (SAT)

i been playing around with SAT collision, and figured out the most part. (By copying/writing codes from countless sites). The SAT collision detection works, since it detects a collision. Now the MTV ...
0
votes
1answer
32 views

Filling up the empty blocks when the player touches the safe zone again! using cocos2d

Hi guys i am stuck with filling up the data of all the blocks which are empty like the ones in the image. As you can see there i have a pacman like object where i will be moving around. But when ...
1
vote
2answers
93 views

Really simple count down timer

I'm making a little 2D tank game that fires bullets depending on where you click (This has been done and works a treat). I'm currently working on a timer class with a simple function that displays a ...
0
votes
0answers
8 views

FreeType2 Crash on FT_Init_FreeType in xcode(cocos2dx) [migrated]

I'm currently trying to learn how to use the FreeType2 library for drawing fonts with OpenGL. However, when I start the program it immediately crashes with the following error: problem loading file ...
0
votes
2answers
100 views

Creating A TickRate Class

I need to implement tickrate into my engine to handle timed events such as pushing out entity updates and I don't know where to start. I have access to a timer which allows me get the time in ...
1
vote
0answers
66 views

Assimp skeletal animation matrices

I startded to make an assimp only opengl skeletal animation demo. For that I used this: http://sourceforge.net/p/assimp/discussion/817654/thread/5462cbf5 And something is not correct in bone matrices. ...
0
votes
0answers
25 views

cocos2d-x .. How to detect which sprites are underneath a touch event

I was wondering what the best solution is in the following scenario: Lots of sprites floating around on screen. A user can touch one sprite and drag to another sprite. Throughout this entire time, I ...
0
votes
0answers
25 views

Creating a simple race game engine for browser based game [closed]

I want to create a browser based MMO racing game and when raceses take place I want the full race to be visible to all the player on a page that looks like the picture inserted. My idea is to get ...
0
votes
1answer
79 views

Designing Character Movement Need Advice

(This game is written in C++ with GDI+ It's a simple side-scroller.) I am having a problem deciding on how I should handle player movement. Currently it runs at 20 frames per second (I just chose ...
0
votes
2answers
71 views

Mouse Look Controls [on hold]

Right now I am not happy with my mouse look controls for a 3d game I am making. I have it set up so that when the mouse is moved the displacement is calculated and applied to the camera etc then the ...
0
votes
1answer
108 views

Estimated framerate for custom engine?

I've been writing my own engine with C++ and DirectX 11. I've got 3d models loaded in with diffuse maps, normal maps, and shadows. There's other things with the engine but my question doesn't pertain ...
0
votes
1answer
122 views

C++ timer function acts as if time limit is instantly reached if it is less than 1 second [closed]

I'm trying to make a Snake clone with C++ and OpenGL/GLUT, but I've been having trouble with programming the timed input. I made a timer class, as you'll see below, to be used for the short time ...
0
votes
0answers
21 views

Video cutscene on Mac using QTKit?

My game needs to display a video file. The game engine I am using allows extensions via .dynlib files (MacOS dynamic libraries). I changed my source's extension to .mm so I can use QTKit, but it ...
0
votes
1answer
40 views

How to change the Android NDK jni calls dynamically?

Some people are using NativeActivity for working with Android projects exclusively in C++, but this also carries some disadvantages, so I, like many others, decided that I'd use instead a Java glue ...
0
votes
1answer
36 views

DirectX9 Drawing Sprites out of place due to offset

This is my very first time into DirectX. Im trying to make a simple 2D game, just for learning the basics. And i've achieved that. The next step is to draw an animation using sprites. For that, i ...
11
votes
5answers
2k views

How can I run on multiple platforms using a custom engine?

Game engines like Unity and Unreal can run on mutiple platforms. I am wondering how they do this. I have been using C++ and OpenGL for a while, and what I am looking for is resources to integrate ...
2
votes
2answers
193 views

Update and render in separate threads

I'm creating a simple 2D game engine and I want to update and render the sprites in different threads, to learn how it is done. I need to synchronise the update thread and the render one. ...
0
votes
1answer
79 views

How do I handle this type of collision?

So I've been messing around with simple game development for a while and just found an interesting game idea here . I'm using SFML 2.1 with C++ and so far I have a tilemap in a VertexArray using a ...
0
votes
0answers
106 views

Problem when using two different shaders

I have created a simple shader for drawing my scene in OpenGL. When another shader was introduced, a problem appeared. I use the first shader and draw few objects in the scene. Then I use the second ...
1
vote
2answers
109 views

Implementing directional lighting in voxel based polygon-engine

I'm having trouble implementing directional lighting. (I'm not that familiar with 3D.) The problem is that the lighting does not "follow/flow with" the other blocks next to them. How should I fix ...
0
votes
0answers
33 views

DX9 system crash on Intel Atom CPU Z530 with Intel GMA 500

our project has to run on a very specific hardware, which is listed below: WinXP Professional 32bit Intel Atom CPU Z530 with Intel GMA 500 (2 CPUs, 1.6Ghz, 512 MB RAM) DX 9.0c 800 MB swap memory ...
1
vote
1answer
33 views

glDeleteBuffers causing other objects not to draw

I have few objects in scene and they exist until I turn off the application. Their calls for glDeleteBuffers are in destructor. Since I don't delete anything in the middle of the game everything is ...
1
vote
0answers
169 views

Get derived Pawn from collision actor in UE4

I am trying to build a basic RTS unit selection but any time I try to possess the target pawn it crashes. The pawn in the collision is a blueprint derived directly from APawn. Am I casting from the ...
1
vote
1answer
91 views

Game Engine Entity/Component with Services Architecture

I'm currently working on my first game engine and decided to use the entity/component model with services. Background: My GameEngine class is an Entity and has multiple services that are Components, ...
3
votes
1answer
127 views

game mod security question

So I'm in the process of building a game in C++ for the engine and Python for behavior and moddability. One of the planned major features is that when the game client connects to a game server with ...
2
votes
0answers
24 views

SDL_AddTimer + SDL_GL_MakeCurrent not working on Windows

I'm messing around with C++, OpenGL and SDL doing a game that should be able to run in Windows and Mac OS X. I have a problem that only happens on Windows. Let me describe the scenario. First I ...
15
votes
3answers
3k views

Does allocating and freeing a huge chunk of memory at startup “clean up memory”?

The book Game Coding Complete, Fourth Edition, chapter 5 (Game Initialization and Shutdown), section Checking Memory contains this interesting code sample: bool CheckMemory(const DWORDLONG ...
2
votes
1answer
149 views

How can I manage entities(in entity component system) using Lua scripts?

Suppose I have a code like this in C++ // Game.cpp Entity* hero; Entity* witch; ... // entity initialization if(/player near witch/) { if(hero->get<HealthComponent>()->getHealth() ...
0
votes
0answers
61 views

Tile Collision - subtracting a minor value to the box size

I'm having a certain problem when doing collision checks on bounding boxes that have their edges aligned with upper or right tiles. It shouldn't count as an intersection but I don't know a good ...
1
vote
2answers
149 views

Is video compositing feasible?

I've been considering the idea of a game client that acted as a video compositor, only drawing, by itself, the terrain, the characters... deferring other graphic elements to separate processes. For ...
1
vote
0answers
91 views

OpenGL Hello Triangle troubles [closed]

Just trying to get the simple OpenGL hello world program set up and for what ever reason I just cant see why I can't get it to work. I'm able to create a resizeable window and set the background ...
-1
votes
0answers
34 views

How to fill a sprite with a pattern image in Cocos2D-X v3?

I'm searching for a solution on how to fill a sprite with a pattern image. I have searched on google and many websites/forums but I've only found solutions for Cocos2d not Cocos2d-x v3. Many thanks ...
1
vote
0answers
13 views

Input handling system using the command pattern [migrated]

The online book Game Programming Patterns briefly describes the use of the command pattern to handle input in a game. I've attempted to write my own "one size fits all" input handling system based on ...
2
votes
4answers
77 views

Identifying groupings of objects

I have a cloud of objects, each with a 3D position, and I want to pick out tight groups of these objects. Specifically, I want to find all objects which form a grouping of radius r within a large ...
2
votes
2answers
205 views

How can I simplify this code to compute the shortest rotation between two angles?

The following code will find the shortest rotation (in radians) (from pi to -pi) that I need to apply to from to leave me with to. Scalar rotationBetween(Scalar from, Scalar to) { Scalar fromMod ...
2
votes
0answers
156 views

Why are god objects so common in game programming? [closed]

This is a bit of a philosophical question. Excuse me if it's out of place here. Most modern games developed in C++ use (or at least purport to use) an object-oriented approach. A common axiom of ...
0
votes
1answer
60 views

Bullet 3D Physics Objects Not Rotating?

So I've got Bullet 3D controlling the motion of objects rendered with DirectX. In the clipping below I've got 2 identical rectangles & 5 balls. The lowest rectangle has a mass of 0 and doesn't ...