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

learn more… | top users | synonyms

0
votes
0answers
4 views

Translating a Tutorial from GLFW to SDL [on hold]

I've been using this tutorial series to teach myself OpenGL. However, I wanted to use SDL instead of GLFW because SDL seems to be more ubiquitous and I have an SDL project already set up in VS2013. I ...
0
votes
1answer
281 views

Should I draw directly on a CCLayer or a CCSprite?

Now I am a little confused in my cocos2d-x cpp project. I want to draw lines with user's finger touch. Following the screenshot of a CCScene: In the screen, there are two squares. I want show an ...
1
vote
0answers
14 views

Are custom data types a possible and viable option for variable size efficency? [migrated]

Instead of storing a single boolean into a byte block, why not store 8 booleans in that same block. Example: 01010101 = 8 booleans, 1 3 5 7 = false, 2 4 6 8 = true. Would this work? is there a ...
0
votes
1answer
278 views

Sorting for 2D Drawing

okie, looked through quite a few similar questions but still feel the need to ask mine specifically (I know, crazy). Anyhoo: I am drawing a game in 2D (isometric) My objects have their own arrays. ...
-1
votes
0answers
3 views

SDL_Flip identifier not found [on hold]

#include "game.h" #include "character.h" #include "music.h" #include "fog.h" #include "background.h" #include "zombie.h" #include <vector> #include <SDL.h> int main(int argc, char** ...
-1
votes
0answers
25 views

How to manage interpolations?

I would like to implement a class to manage interpolations and I don't know how to to it, my goal is to make something like that (at 2:00). For now, I've got a class to make different type of ...
0
votes
0answers
36 views

C++: vector<Foo*> with reserve(), push_back() destroying values [migrated]

The title is a tad confusing. Here is a greatly compressed version of my current predicament: Classes.h: class Foo { int x; Foo(): x(0) { } Foo(int y): x(y) { } }; class B { ...
1
vote
1answer
169 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 ...
1
vote
2answers
59 views

DirectX Quaternion SLERP Wrong Answer?

I have some code that looks like this: DirectX::XMVECTOR a, b, c; a = DirectX::XMQuaternionIdentity(); b = DirectX::XMQuaternionRotationAxis(DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f), 3.1415f); c ...
0
votes
0answers
16 views

Add 3d modeler in active environment? [on hold]

I'm trying to find the best way to add in a 3d modeler that can be accessed in-game. I was thinking of using Blender's source-code and implementing it that way but I'm concerned about performance ...
-1
votes
0answers
60 views

How can I generate passive 3D using a consumer level graphics card?

I would like to how to generate packed frames and sent them by HDMI to a 3DTV for passive stereo visualization, using any consumer-grade graphics card. I am working on Linux, and programming in C++. ...
1
vote
1answer
59 views

c++ RPG - Handling buffs / equipment stats [duplicate]

I'm trying to develop a character calculator for a RPG, and it could evolve into a turn based combat / text based RPG. One of my concerns is how to handle the equipment stats / buff system. ...
3
votes
1answer
191 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 ...
5
votes
4answers
307 views
+50

OpenGL lighting appears to be clamping

I'm experiencing an odd problem where everything placed in front of my light appears black in my scene. This happens on multiple axes. I've searched the depths of the internet to find a solution, but ...
-1
votes
1answer
74 views

How to move object along circumference of another object? [on hold]

I have following piece of code, now i want to move the "moon" object in the orbit around "earth". please help!! #include <stdio.h> #include <conio.h> #include <graphics.h> #include ...
0
votes
2answers
41 views

Overload how an object instance of a class is treated when used

So I've made this struct that encapsulates a glm::vec4. This is because vec3s are treated as 16-byte in GLSL, but I don't want to assign a vec4 if I only really need 3 components. Anyway, my question ...
0
votes
0answers
52 views

How do I procedurally generate a different animal randomly with object oriented programming in C++? [duplicate]

I am working on a puzzle game, which generates a different animal every time they. reach a cage at the top of the screen. I have the object code written down so that it respawns at the bottom again to ...
0
votes
1answer
67 views

Constant buffer not updating

I'm trying to rotate models independently of each other however I cannot for the life of my figure out how. I have gotten to the stage of writing this: std::vector<int>::size_type st = ...
1
vote
1answer
247 views

How can I correctly use an unordered_multimap as entity and component storage?

The Setup I've made a few games (more like animations) using the Object Oriented method with base classes for objects that extend them, and objects that extend those, and found I couldn't wrap my ...
12
votes
2answers
3k views

Implementing a camera / viewport to a 2D game

What is the most practical way to implement camera/viewport to a 2D-game? I've read, that I should store the object world position instead of position relative to the screen? Current situation: I ...
-2
votes
0answers
51 views

Where can I look for a game modding savvy C++ gameplay programmer? [closed]

I am looking for a C++ gameplay programmer who in the past modded Quake1/2/3 and derivatives, Doom 3 and derivatives or UT series, to help me with my game project. I tried ModDb job board with a ...
0
votes
0answers
11 views

SDL_Mixer .xm file loop not working correctly

I am working on a little game in my spare time using C++ and SDL and I have encountered a problem with a .xm file playback. The music is supposed to have an intro of a couple patterns and then ...
0
votes
0answers
26 views

Multiplayer movimentation and animations [closed]

I'm planning my first multiplayer game that will be similar to this: http://www.youtube.com/watch?feature=player_embedded&v=N9ii54dYO6w I will make the client in C++/DarkGDK and the server in ...
0
votes
1answer
62 views

Cocos2d-x how to draw in specific free form area

Here https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.h and https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.cpp you can see how ...
0
votes
0answers
24 views

Formal parameter with _declspec(align(16)) [closed]

I am currently trying to learn DirectX. So I was using one of the old templates from my teacher where everything is set up. As I am done with the course, I am moving away from these things I renamed ...
0
votes
0answers
46 views

Trying to bounce a box with a plane using bullet physics

I'm trying to simulate a box that bounces with a plane and I'm beginner with bullet physics. I created a plane (box) and and a box that is falling. The problem is the ball is stalled while colliding ...
0
votes
0answers
31 views

Update DirectX 11 Texture Created in Unity Asynchronously in the Native (c++) Plugin

Sorry for the long question :D tl;dr version :) Is it possible to update DirectX 11 textures created in Unity asynchronously in a native plugin (C++)? I've written a plugin that retrieves data from ...
0
votes
1answer
145 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
vote
1answer
44 views

How can I fix user input for this pong paddle?

I have been having trouble with my pong paddle - It responds to user input as if it was typing. Sometimes, people try to react to KeyPressed events directly to implement smooth movement. Doing so ...
0
votes
1answer
74 views

Animation, Interpolation, & Structure

I have been working on animation in my small game engine recently and I am implementing some interpolation to be used with skeletal animations. I know how to do interpolation but I am not sure where ...
1
vote
2answers
32 views

Dynamic Flow Control in HLSL with Array References

I'm trying to do lighting calculations for an array of point lights in HLSL. I simply want to pass light direction vectors from the vertex shader to the pixel shader. Here is sample code: static ...
0
votes
1answer
46 views

My texture blends into one single color (DirectX11)

First thread on gamedev stackexchange. I am currently creating a cube with a single texture on each side. I got my cube up and running. But when I apply my texture, I get this: It blends the ...
19
votes
7answers
6k views

How can one implement hot-swappable C++ modules?

Fast iteration times are key to developing games, much more so than fancy graphics and engines with truckloads of features in my opinion. No wonder many small developers choose scripting languages. ...
0
votes
1answer
101 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 ...
35
votes
9answers
4k views

How are deterministic games possible in the face of floating-point non-determinism?

To make a game like an RTS networked, I've seen a number of answers here suggest to make the game completely deterministic; then you only have to transfer the users' actions to each other, and lag ...
0
votes
0answers
25 views

Angel2D won't find GLFW

I'm doing my first steps with C++ and game development to build a simple prototype. I've chosen Angel2D as framework to get some help from the beginning but I have problems to get it working with a ...
0
votes
0answers
20 views

How to properly transform vertices for a model loaded using Assimp?

When I try to load a DAE model then vertices are not placed correctly. Here's the code snippet I use to load 3D models using Assimp : aiNode* CGameObject::findNode(aiNode* rootNode, const char ...
0
votes
0answers
31 views

When camera moves the textures move and rotate

I recently followed the tutorial at PaulsProjects on shadow mapping. After finishing the tutorial all of my textures seemed to have vanished, then I moved my camera and the texture reappeared. But the ...
2
votes
5answers
3k views

How do i choose what technology to use for a 2D game like Pokemon? [closed]

I apologize in advance for the wall of text about to come. I've had an idea for a game for a while now, and am stuck at step 1 of game development: Choosing a language/engine. I've read a whole ...
1
vote
1answer
32 views

CopySubresourceRegion results in no-op

I'm having some trouble copying a subregion from a source texture (2D) to a destination texture. Both textures are mipmapped 2D textures, with dimensions (at mip 0) of 512 x 32. Rather than tell you ...
1
vote
1answer
254 views

Calculating shadowmap coordinates for cubemap in shading pass?

I'm trying to implement shadow mapping with cube maps. I believe I've done the first stage by filling the cube map, but for the final shading pass I am unsure how to exactly calculate the cubemap ...
0
votes
2answers
39 views

How can I change the value of a matrix uniform in an OpenGL vertex shader?

I'm new at OpenGL. I have a uniform transform matrix in a vertex shader file. I want to modify the matrix by individually assigning each values in the matrix. How can I do that in C++? I learned that ...
0
votes
1answer
176 views

Why does my SFML game cause screen tearing on Linux?

I wrote a little game of a bouncing ball, using SFML and Box2D. On Windows, the graphics animate smoothly. However, on my Linux machine, the animation stutters randomly. To be precise, I get a ...
0
votes
1answer
186 views

Linking error when compiling Allegro example [closed]

I am currently learning about game development tools and decided to use Allegro and OpenGL for starters. I've run into some problems in getting examples to compile though. It seems the allergro.h ...
3
votes
2answers
1k 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 class MyClass : public BaseObject { ...
-4
votes
1answer
163 views

For loop optimisation [closed]

Here are some variations of for loops: 1) Standard: for (int i=0; i<limit; i++) 2) Using preincrement for (int i=0; i<limit; ++i) 3) Inverting the loop for (int i=limit-1; i>=0; i--) ...
2
votes
2answers
753 views

Was C++ designed for speed, and is it better to not use high level features when teaming with inexperienced programmers? [closed]

I have read some optimisation guide for C++, and it seems it requires more knowledge to have a fast C++ code, than using C++ without the high level features of C++ (classes, templates, inheritance, ...
0
votes
0answers
29 views

“Unresolved external symbol” errors in DirectX: LNK1120 and LNK2019 [duplicate]

I'm making a DirectX 11 framework, but debugging gives me these errors: error LNK2019: unresolved external symbol __imp__DrvGetModuleHandle referenced in function "private: void __thiscall ...
0
votes
1answer
147 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
vote
1answer
138 views

C++ Ray Traversing in 3D Voxel game

I'm currently working on a Voxel game in 3D and need a tad bit of help to figure out what Voxel the player is looking at. This is the data I currently have: GRRLIB_Camera3dSettings(Player.x, ...