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

learn more… | top users | synonyms

0
votes
0answers
32 views

Resource manager or managed resources? [on hold]

Background: Previously I created a resource cache system that the user did not see; from their point of view they just created/deleted a sprite (or sound, etc.) and internally a reference counted ...
0
votes
0answers
10 views

Searching for der_ton's md5 exporter for 3dsmax [on hold]

http://www.doom3world.org seems to be offline, i would like to get hold of this exporter to use with a c++/DirectX 11 application , if anyone can help out that would be great
0
votes
0answers
29 views

2D AABB vs AABB side of collision and collision depth

I realize there have been a multitude of questions involving 2D AABB vs AABB collision, but the questions and responses always avoid the simple questions that make it difficult. To keep things ...
0
votes
0answers
33 views

OpenGL geodesic hemisphere [on hold]

Good afternoon, I draw a geodesic hemisphere using opengl for Delphi released this code const X = 0.525731112119133606; Z = 0.850650808352039932; vdata : array [0..11] of array [0..2] of ...
5
votes
2answers
114 views

Decoupling assets, instances and the rendering module [on hold]

I am trying to redesign a home-grown hobby engine. It became apparent that it was far too tightly coupled and so I'm trying to redesign it in a more modular way. Unfortunately, I'm baffled by the ...
1
vote
1answer
76 views

How to rotate an object so that it is aligned with a vector?

I have the following Scenario: Two moving objects (A and B in the picture) need to appear "connected" by a third one (C in the picture). I set the position of the connecting object C as "halfway" ...
-2
votes
0answers
32 views

SDL - Annoying error checking [on hold]

Alright, hello guys so i am trying to make my first C++ game using SDL, and i ran into the problem, so please take a look in the following source code it is not big it has like 4 files, for someone ...
0
votes
0answers
37 views

Stuck with which approach to take (architecture) [on hold]

I am currently in the process of building a 3d game engine in c++ however I have kind of slowed down development because I am unsure of the architecture that I want to use, more specifically the ...
2
votes
3answers
84 views

Hero made of parts 2d rotation

I have a problem with rotation of my hero in 2D space. The hero is made of body parts such as: head, arms etc. Every part is a separate sprite. When I want to rotate the hero, I have to rotate all ...
1
vote
1answer
75 views

Space invaders implementation

I'm just wondering about the implementing of the collision response of bullets and the fours obstacles. https://www.youtube.com/watch?v=LCNTwG3MGEg When a bullet hit, a one black pixel is ...
1
vote
2answers
84 views

Collision detection between triangle and polygon

I have some difficulties to understand how to be sure if there is a collision between a space ship (black) and an asteroid (in blue). A space ship is placed on a case and an asteroid comes from the ...
1
vote
1answer
40 views

How can I get a reference to a object in the world in UE4?

I'm coding a simple maze game in UE4 and I have everything I wanted to implement done except having an obstacle in the scene. What I have is a simple Obstacle class which is a child of an Actor class. ...
2
votes
1answer
33 views

change animations when touch sprites [on hold]

In the following function I want to change the animation when I touch on the button. But the game crash and exit. What's wrong with this code ? bool GameScene::onTouchBegan(cocos2d::Touch *touch ...
-1
votes
0answers
20 views

SFML draw throws exception [closed]

Whenever I try to call the draw function (RenderWindow), I get an unhandled exception: Unhandled exception at 0x74A0C9F1 in Shard.exe: 0xC0000005: Access violation executing location 0x00000000. ...
1
vote
1answer
57 views

Using GetTickCount (to shoot missiles) [closed]

I have some difficulties to understand how to correctly use GetTickCount() as I have some problems in my little game. I have to place on a case a space ship. This one will shoot with a certain ...
0
votes
0answers
17 views

Naming problem with method that visualise the unrenderable objects (helpers) [closed]

I'm creating some game engine in C++. I am stuck with the naming problem. I know that some of you think it's not so big deal, but badly named things = things that will mislead you in future (bad ...
0
votes
1answer
64 views

c++ - collision detection/resolution clipping

I'm trying to implement a collision detection system, and it is working for the most part, no overlapping (or at most very little overlapping) of characters, and wall collisions. The problem is that i ...
4
votes
3answers
118 views

How to handle multiple events in SDL2 and C++?

I'm working on an entity component based game and I ran into this problem. I've got a component called PlayerControlComponent: void PlayerControlComponent::HandleInput() { SDL_Event event; ...
3
votes
1answer
102 views

Why is my DX9 render target restricted to 512×512?

When I use a render target higher in resolution than 512×512, I receive an image with black borders, depending on how big this texture was. Why is this? How can I fix it? Here's how I create the ...
4
votes
2answers
360 views

Is there an alternative to VBOs or deprecated functions to draw many small quads?

I was thinking about how to program a user interface in a 3D game. The problem is, immediate mode (glBegin and glEnd) is deprecated for a long time but I don't think vertex buffer objects (or arrays) ...
4
votes
2answers
104 views

Stroring components in arrays (entity component system)

I'm looking for ways to improve my ECS and I've seen many people suggest storing components in arrays. This seems great, considering fast access for a component using entity id and more importantly, ...
2
votes
2answers
94 views

How to get a component from an Entity?

In my Entity class I've got a function that returns a specific component, that looks like this: template<typename ComponentType> ComponentType* GetComponent() { for(unsigned int i = 0; i ...
0
votes
2answers
45 views

Undefined reference error when trying to access a component using ECS [closed]

I'm trying to access the x and y values from PositionComponent in my MovementComponent but I get this error and I just can't figure out why I get this. in my Entity class I've got a function ...
0
votes
0answers
8 views

Fill color in moving object without flickering [duplicate]

Here is my code in which moon is moving around earth but now i want to fill moon and earth with color and also want to remove flickering in the moon while moving. Please help me, i will be very ...
1
vote
1answer
59 views

How can I stop my collision detection from registering multiple times per frame?

I am working on a side-scroller shooter right now. Everything is working fine along with the collision detection however, my problem is that the collision triggers my health deduction code multiple ...
1
vote
1answer
147 views

Firing bullets with a time interval between them [duplicate]

How can I make my enemies shoot bullets in intervals? I already have the enemy shooting bullets, however my problem is that it shoots the next bullet instantly, making it look like a line instead of ...
0
votes
3answers
70 views

Logic level representation that distinguishes “<<under>> and <<above>> the bridge”

I have an logic level/map representation for a 3D game that uses vector<Area> where: class Area{ vector<Point2D> bounding; //determines the shape of the Area, its borders ...
0
votes
1answer
71 views

AABB swept collision response with voxel world

I followed this tutorial: link and I was able to make it work with 3d voxel world collisions. But the problem I have is with collision response. I want to make player slide against the wall if he is ...
0
votes
1answer
55 views

Rectangle collision in SDL2 partially allowing sliding C++ [closed]

I am working on a game in SDL2, in which the player needs to be able to slide along walls, but NOT go through them. I've read up on things like Quadtrees, and this stackoverflow question ...
1
vote
1answer
57 views

Where should I put the SDL_Renderer* using the ECS with SDL2 and C++?

So I'm still learning about ECS (Entity Component System) and whenever I'm thinking about the architecture and actual implementation, I just can't figure out where should I put the SDL_Renderer*. So ...
4
votes
1answer
261 views

C++ OpenGL ShadowMap Issue/Artifacts

I am currently implementing basic shadow mapping in my C++ Custom Engine using GLSL 4.10. It is currently working with basic PCF anti-aliasing and very minimal reduction for unwanted artifacts. Here ...
1
vote
4answers
97 views

How to order points on a 3D grid such that we can connect them in a line loop correctly

I want to recreate an effect as close as possible to X-Com: Enemy Unkown's movement range feedback: The blue line delimits the tiles which the soldier can reach using a single action. We also are ...
0
votes
0answers
45 views

OpenGL Occlusion Culling - flickering problems

I have implemented occlusion culling in my app and I think why the problem is happening but I am not sure how to solve it. My scene is divided in different chunks (voxels) and I am rendering each ...
0
votes
1answer
63 views

Directx: HLSL Texture based height map. (Shader 5.0)

I'm trying to implement a GPU based height map the simplest (and fastest) way that I know how. I passed a (.png, D3DX11CreateShaderResourceViewFromFile()) texture into the shader, and I'm attempting ...
2
votes
2answers
109 views

Intersection between moving circle and some squares

I'm developing a 2D game made of squares. What I need to do is check if a circle collides with any of the squares as it moves. I have a raycast function to check the same idea, but using a point. I ...
0
votes
1answer
85 views

Triangle-Triangle Intersection Code

Does anyone have experience implementing this triangle-triangle intersection code that I found online? I don't understand it. I made a post on Stack Overflow about this and got the advice that: ...
3
votes
2answers
102 views

Sound Synthesis from object collision in Virtual Reality Environment

I have a project whose subject is "Sound Synthesis from object collision in Virtual Reality Environment" First of all, I have to define some objects with certain attributes (like shape, mass, ...
0
votes
1answer
57 views

How to compute matrix transform local/world on OpenGL

I'm developing an OpenGL program where each object / entity contains m_WorldPosition, m_WorldOrientation, m_WorldScale and m_WorldTransform (Vector3, Quaternion, Vector3 and Matrix4f). The problem is ...
1
vote
2answers
108 views

How to avoid checking the same triangle twice in collision detection with spatial hashing

I'm implementing a spatial hashing system to speed up my collision detection, but I've run into a problem. Since a triangle can be hashed into multiple buckets, how do I ensure that I don't check the ...
3
votes
1answer
137 views

Is std::deque the best option for storing my graphics objects?

I am currently implementing an object buffer, which stores all the objects used in the game at one place. All other components of the game, like the user interface, the level loader, etc, add objects ...
1
vote
1answer
112 views

2D graphic over 3D perspective projection

To draw a 2D HUD (just a simple trianlge, for now) over 3D graphics in OpenGL I : draw all 3D objects, then call glDisable(GL_DEPTH_TEST) before drawing 2D HUD draw 2D triangle call ...
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
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
votes
0answers
76 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
81 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. ...
1
vote
2answers
83 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 ...
-1
votes
1answer
91 views

How to move object along circumference of another object? [closed]

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
48 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 ...
1
vote
0answers
23 views

SDL_Mixer .xm file loop not working correctly [on hold]

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
61 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 ...