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

learn more… | top users | synonyms

0
votes
3answers
79 views

2D Box Collision Trouble

Hello I am trying to handle some simple box collision (axis-aligned) in my top-down 2d game, but running into a problem. My game is running at a fixed time step, and checks for player-wall collision ...
0
votes
0answers
10 views

Box2d c++ can't see b2PolygonShape

i try to follow this tutorial and convert it to c++ http://www.emanueleferonato.com/2009/04/06/two-ways-to-make-box2d-cars/ the second part of the tutorial Now im facing very strange Behaviorno ...
0
votes
1answer
52 views

SDL2: Unable to get center of screen when drawing more than one texture?

so I've been trying for the last four hours to get this to work and although I can get to the center of the screen when printing one texture using: ...
1
vote
2answers
63 views

Updating children nodes in a game engine

I am writing my own small game engine (thin layer based on SDL2) in C++. My base class is Node (contains information on an entity's position, scale, rotation, etc.), And I've got two special ...
6
votes
1answer
193 views

C++ exensible resource manager class with dynamic registration of factories

I've done some some research on my own, so I hope someone can help me finish it. I'm trying to replicate the design of an extensible asset manager featured in this answer. At the moment I have ...
1
vote
1answer
107 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, ...
0
votes
1answer
36 views

Input Assembler - Vertex Shader linkage error

I'm new to HLSL and have been struggling with this problem for a while and I can't figure it out. I'm getting the below error a number of times in the debug window: D3D11 ERROR: ...
0
votes
1answer
30 views

SDL2 LogInfo not outputting with different category?

So this is probably really simple but I just cannot see it. I've made my own log class using the SDL_Log functions to output to the console. Only thing is, is that it only outputs using one category ...
0
votes
1answer
22 views

FindNextValidTechnique fails

My effect file compiles successfully, but FindNextValidTechnique fails. Technique part of the shader: technique Diffuse { pass Pass0 { VertexShader = compile vs_2_0 ...
0
votes
1answer
49 views

Button image on game menu is updating too slow

I'm using SDL2 and i'm facing a problem with my game menu buttons. Every time i detect that the mouse pointer is over a button of the menu i update the image of the button (from MOUSE_OUT to ...
0
votes
1answer
55 views

Orthographic viewport zooming

I'm a bit new in opengl so please bear with me. I have a viewport window like this I have implemented zoom in/out features using the arrow keys. The problem is it zooms in and out with the whole ...
0
votes
0answers
18 views

How to convert ticks to clock cycles when profiling API calls [migrated]

I am profiling Direct3D9 API calls. I have read a lot of documentation here that describes the process. I have a question though about calculating the elapsed clock cycles. Here is my current method: ...
0
votes
1answer
59 views

Parsing Blender exported collada file in c++

Since I could not find any libraries that can help me parse collada files in my c++/opengl project, I decided to write my own. (I did find assimp, but binaries for Visual Studio 2013 were't available, ...
0
votes
1answer
82 views

Missing Visual Studio 2013 Templates [closed]

Visual Studio 2013 is missing the installed templates related to graphics, SPECIFICALLY the fbx scene template.. Why is this so? And where do I get them ?
0
votes
1answer
27 views

Making a ordered list iterator [closed]

Noob here, I am trying to display a list of a vector with ascending numbers. To display the list I iterate through the following code. cout << "\nYour games list is: \n"; for (iter = ...
0
votes
1answer
54 views

Sorting sprite's layers in isometric view

I'm making a strategy game with isometric view and I'm having some problems with deciding which sprite should be drawn first (I'm using SFML 2.2 as graphic library). I'm using std::sort to sort ...
0
votes
0answers
29 views

How to implement Lua thread for Sleep function

I am running into a problem in my game engine right now. I want to be able to call Sleep(number_of_seconds) from .lua file (1 only) and halt the execution of the lua file, WHILE the game is running ...
-1
votes
1answer
78 views

Should I use octree or quadtree for my spacial data structures? [closed]

I would like to know the advantages and disadvantages of using octree or quadtree for spacial data structures? In a 3d gaming setting would you ever need more than 4 children nodes? Does it take ...
0
votes
2answers
79 views

Moving one object from one point to another with acceleration

How would someone implement moving an object from one point in 2D space to another using these formulae to update objects: m_position.setX/Y( m_position.X/Y() + m_velocity.X/Y() * dt + 0.5 * m_acc * ...
1
vote
1answer
121 views

C++ Frogger game - Logs on Water bounding boxes?

I am making a Frogger game in C++ using SFML but have come across a problem. I have a block of water and log rectangles moving over it (All sprites) and would like the Frog sprite to do something when ...
0
votes
1answer
35 views

Extra sprite spawning when the enemies are redrawn SFML

I am making a game in sfml and at the moment when all of the enemies die. They are set to respawn however when this is happening they are respawning with one extra sprite than before. The code for ...
1
vote
1answer
98 views

OpenGL VBO and VAO Confusion

I would like to present here my Question about VBOs and VAOs. Basically from what i understand you can have different VAOs each of which can contain up to several VBOs , and by binding to the VAO's ID ...
0
votes
1answer
28 views

How can I get the “SelfActor” in OnBeginActorOverlap?

The signature it takes is void ( AActor* OtherActor ) However, The actor that is handling this event is not involved in the overlap. How can I access the actor that owns this delegate? Assuming I ...
0
votes
1answer
46 views

Why aren't all public methods BlueprintCallable by default?

Considering the entire point of public/protected/private encapsulation is to abstract the class so it's easy to use, why does the programmer also have to decide if a method is callable from ...
0
votes
0answers
19 views

change position/orientation of a bone using assimp

I have been using assimp to import rigged models and animations. I followed this tutorial for skeletal animation and I have got it done properly. The part that I am trying to do now is to orient a ...
1
vote
0answers
53 views

Rotating a 3rd person camera toward a target

I have a 3rd person camera that doesn't look directly at the player but somewhere in front of him. When the user enter shooting mode, I want the camera to turn around the player to face the target. ...
0
votes
1answer
64 views

JNI multidimensional array as return value

I have some C++ code that I wrote to generate voxel terrain and would like to access it in JAVA. you pass it three integers; the seed and the coordinates of the chunk that it is generating ...
0
votes
2answers
42 views

How should data about past interactions be stored?

I have been developing a text-based rpg in C++, using sqlite as my database. When it comes to interactions that change the world around the player in some permanent fashion I have been unable to find ...
0
votes
1answer
109 views

Best way to handle movement input?

I'm currently developing a RPG movement system in c++, and tried to use the State Pattern/State machine for this, but AFAIK I would have to check each movement key in every state.(right?) Is there a ...
0
votes
1answer
19 views

Maya 2015 Collada mesh transforms not applied

I am trying to load a dae (Collada) model into my 3d engine. The problem is they export the vertices and transforms seperately. So in Maya 2015 it looks like this In the game engine I have it simply ...
3
votes
1answer
130 views

How can I optimize per-pixel drawing in SDL?

I've been messing around with C++ the last few days and I'm trying to figure out how to draw the screen pixel by pixel each frame. It sounded simple enough at first, but then I realized for loops ...
2
votes
0answers
63 views

OpenGL Planet Generation - Simple Matrix Issue (Planet “Spins” With Mouse)

I originally asked this question on StackOverflow & was directed here by a commenter. Im currently working on a OpenGL planet rendering. I'm using the Tessellation pipeline. So far things are ...
0
votes
0answers
29 views

Pseudo 3D questions in SDL/C++ [duplicate]

I'm going for a SNES mode 7 effect. From my understanding you do maths, to grab the current pixel from z values. Resulting from this math you take an image and then transcribe it into the screen for a ...
0
votes
1answer
90 views

Handling (spawning/removing) entities in SFML

I am unsure which method to use to handle my enemies in SFML. The idea that I am trying to recreate is to spawn enemies every so many seconds. Initially I wanted to do this using a vector such as ...
0
votes
0answers
51 views

Modern OpenGL, rendering multiple obj objects not working

I am currently working on a 3D Game Engine that loads a level from an OBJ file and renders it with OpenGL. My problem is related to understanding how to render each object individually when i have ...
0
votes
0answers
47 views

resolving per pixel collision issue

In space invader, I'm doing bullet to barrier intersection using rect to rect, then I'm testing the first bullet's impact pixel, if it's green I blast a circle, if it's black, it continues travelling. ...
0
votes
0answers
17 views

DirectX 9 - Troubles on PRT

Does anyone tried to use PRT? I'm asking this because i didn't find out anything in the internet that may help me solve my problem without asking here for help. So my question is - why the code below ...
5
votes
1answer
232 views

Elegantly simulating NPC movement in inactive areas

My AI is utility-driven in a similar pattern to The Sims, where all unique behavior is coded into interactable objects, and the only thing an NPC does is decide which object they wish to use, path to ...
0
votes
1answer
48 views

missiles skip in collision detection

I'm trying to work on spaceinvader. I have problem that missiles or the bullets skip frames due to its fast speed. I tried to use the previous position of the bullet in the collision check, but still, ...
0
votes
2answers
85 views

State Machine class vs function pointers [closed]

What do you guys recommend to use? A State Machine with function pointers or classes? Or, in which case one would be better than the other one? At work we use the state machine with function ...
0
votes
1answer
91 views

Game mechanic player following path looks very roughly

I want my player entity to follow a path, which works, but it looks very roughly. Like it would stuck everytime. bool arrivedX = false; bool arrivedY = false; float speed = 0.06f; ...
0
votes
0answers
62 views

Python interpreter as in-game console

Say I have a game which has lots objects (NPCs, monsters, etc.), I want a console so I can change the variables of the objects (like changing HP for example), how could I embed python into my program, ...
0
votes
0answers
32 views

Steam for Linux platform libraries causing Qt application misbehavior

I'm currently having difficulties with a very simple launcher application that's intended to display a webpage and have some buttons to launch a game. When you click a link inside of the launcher it ...
1
vote
1answer
62 views

How do I compile further libraries into my game? [closed]

This might be vague; I don't know how to search for this. How do I link a GUI framework (in my case, CEGUI) to a graphics framework (in my case, SDL)? I'm using a Mac. My mental model on how to add ...
0
votes
2answers
144 views

Space invader barrier implementation algorithm

I've been struggling with implementing the space invader bullet to barriers. I wanted right now to blast a circle around, when the bullet hits the barrier and modifies the circle. As shown in the ...
0
votes
1answer
53 views

Weird rendering of bounding box

I'm trying to make a bounding rect for my bullet which is in space invader game. I'm using marmalade, and the bounding rect seems translated and doesn't bound the bullet at all, however the math is ...
3
votes
1answer
72 views

OpenGL Indexed VBOS?

I'm a little confused with using indexed vbos in opengl. I understand that different each vertex can only have one uv. How would it be possible to map a texture onto a 3d object if you can't "unwrap" ...
1
vote
1answer
48 views

Runtime resolution changing with GLFW3

I've been trying to figure out the correct method for changing the resolution/fullscreen state of a GLFW window for a while now, but after searching all I found were references of how to do it with ...
1
vote
0answers
41 views

Dynamically allocate memory for object array [closed]

I'm trying to create a RPG game and for a test I thought I might draw the same tile(20x20 pixels) over the whole window(720x480), it works and renders the tiles fine but the amount of memory and CPU ...
0
votes
1answer
69 views

How can I implement triple buffering using Direct3D 9?

I am creating an application using Direct3D 9. I want to implement triple buffering with vsync. I can successfully create a graphics device object with 2 back buffers. How do I know which buffer to ...