Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
673 views

Cocos2d - Physics bodies randomly loosing Velocity along an axis after impact

This just started occurring and seems to randomly happen during, and between, game sessions. A dynamic moving body collides with a static body and instead of bouncing off looses (almost completely) it'...
0
votes
0answers
36 views

Algorithm for drawing DOOM-Style 3D Maps in c++ without graphic APIs

I need an algorithm for drawing maps like the DOOM example below: This is not what I am wanting: This is a Wolfenstein 3D image where it has a wall, ceiling, and floor, not rooms over rooms or steps ...
1
vote
1answer
12 views

Problem with rendering a quad from four lines

I am having a problem with rendering a quad in opengl via 4 lines (5 vertices via GL_LINE_STRIP). The rendering is generally working fine in terms of connecting the lines into a quad. The problem is, ...
0
votes
0answers
17 views

Libnoise bounding box - from spherical to planar

I'm trying to convert a bounding box inside a spherical map (equirectangular image as a result of Libnoise/c++) into a planar projection, but I can't find the correct algorithm for it and I'm not good ...
0
votes
2answers
36 views

UE4 Code Project is not showing sub folders created within C++ Classes Folder even though they exist

These were my steps. Created an empty code project in UDK4. The editor starts up. On the left bottom you have: If you try to right click on C++ Classes, Or select [Add New] while having C++ Classes ...
0
votes
0answers
22 views

what exactly is the logic behind 6502 and precise clock cycle emulation?

Key questions to consider based on page 10 of this document: http://archive.6502.org/datasheets/rockwell_r650x_r651x.pdf What does page 10 imply by "Add 1 to N if page boundary is crossed"? What ...
0
votes
2answers
54 views

SDL2 Block collision with player Bug

I am currently working on a small 2D Games Engine with SDL2 for fun. The engine works in a way, that you can define a tileset, which accesses the engine and allows you to place tile by tile on the ...
14
votes
2answers
4k views

How do I simulate a doppler effect in a game?

I am trying to simulate the doppler effect in a game (a car racing game). I am not using a specific sound library that simulate the effect, I only have a callback function where I mix the data. I ...
6
votes
1answer
301 views

Set the name of an animation in collada to be used by AssImp

I am using the collada file format to contain my model and animation but when I use AssImp to load the file the name will be empty for the animation. Where is the name for animation set on the collada ...
1
vote
2answers
55 views

Parts of 3D model disappear during animation

I'm trying to properly play an animation done in Blender 2.8 inside my OpenGL application. When the animation is running, it happens that at some particular frames, some parts of the 3D model "...
0
votes
1answer
82 views

How to implement an tooltip item cache?

I'm building a tooltip item like that I would like to keep this information cached on the client side, avoiding that whenever the information is displayed it's necessary to make a request to the ...
0
votes
0answers
12 views

How to store UI data?

I'm building a platformer using SFML and C++. Right now, I'm storing all data (texture info, sprite info, level data, audio info) in JSON files, which are then dynamically loaded and unloaded. However,...
1
vote
1answer
748 views

Rotate camera around its center in 2D

I'm currently trying to develop my own little game engine (trying to understand maths in games). I have implemented 4x4 matrices and 2d vectors (I don't need 3d since I'm aiming at orthographic ...
5
votes
1answer
213 views

How do I detect image clicks in Dark GDK?

I am trying to determine if an image has been clicked, using the Dark GDK game engine. I've found no methods in the engine that do this. I would rather not brute force this with a large nested if/...
1
vote
1answer
245 views

C++ - Assimp - OpenGL vertex data feed problem

I'm getting a very weird problem where OpenGL doesn't use the hardware to render anything, so I get just a cleared blank screen. Here's some code: ...
-1
votes
0answers
59 views

Draw a Diagonal Lines in the image by using c/c++

I have an image and wants to draw multiple diagonal lines in the image. if we look into main program it takes input bmp file and generates one pattern. what I need to insert diagonal lines in that ...
0
votes
1answer
79 views

How is tile offsetting accomplished in 2d side scrollers?

The idea is to work with tiles that together make up a larger image, or world so to speak. but im confused as to what the methods used are to offset the tiles, and whether is a good idea to draw ...
0
votes
1answer
52 views

C++:Segmentation fault (core dumped) while creating gameobject

i made a small code to debug and i get this error player inherit from gameobject code ...
0
votes
1answer
84 views

The A * algorithm in the map has many moving objects

I am using the A * algorithm for my game, it is a kind of Isometric map with lots of tiles. If all the game objects are trees, rocks, houses and only one game object is a moving hero, the A * ...
1
vote
2answers
152 views

Are closing window and destroying DirectX11.1 independent?

I have a project with DirectX support. In this program uses two threads. One is a dedicated message loop and the second is executing DirectX API's. The question is about ending such program. The ...
-1
votes
1answer
45 views

C++: passing gameobject as a parameter and then into vector

firstly iam used to java and new to c++ so maybe this will looks a noob's question i will explain this and give a pseudo code and then c++ just so you can understand me i have a player class which ...
0
votes
0answers
39 views

Cyclone LED gaming code HOW TO HELP?

I am very new to programming. For a project I decided to make a game of cyclone using some LEDs,a push button, and a raspberry pi. I researched how to at least start on the game, but the problem that ...
2
votes
0answers
79 views

Structure for a strategy game

I am making a strategy game like Age of Empires. It's a pretty big project and I need a clear game structure. I have defined a Game_Object class with variables ...
1
vote
2answers
484 views

Proper way to update pixel array data

For a game that updates a board every frame I am calculating the next arrangement of board, updating pixel array data and render board as 2D texture to quad the size of the screen using OpenGL. I use:...
0
votes
1answer
39 views

Could not load PNG in SDL2?

I have three image files, one is Techs.png, one is Techs.gif and one is Techs.bmp. I have used SDL_image 2.0.5 and SDL 2. When I load the image of Techs.gif and Techs.bmp, there is no error, but when ...
0
votes
1answer
37 views

Update TTF Texture for Score

I have a little problem with Updating my Score with TTF. Im a neewbie so dont blame me :P I Try to Update my Score But the Buffer Get too small after a while and my Game Crashes. ...
0
votes
1answer
148 views

Need help with an 'Exception thrown:write access violation:this was nullptr' in a c++ - SFML project

I'm currently learning how to program a 2d game with SFML using a tutorial series by Suraj Sharma.This's his channel: https://www.youtube.com/channel/UC2i39AOpDSlO1Mrn1jQ8Xkg The tutorial series: ...
-1
votes
0answers
59 views

asteroids bullet hits the enemy ship

I am making an asteroids like game with 2 space ships. Well I have drawn 2 ships on the screen. Each ship can move and fire bullets at the enemy ship. I am using the sin and cos functions to make the ...
4
votes
1answer
285 views

What Situations is Saving a Game to Main Memory for?

I've been reading through Unreal's 'Saving and Loading' guide: Link Within, they present a capability to save a game to main memory rather than secondary storage: I haven't found any information on ...
-2
votes
2answers
83 views

Loading the map from an image file in C++

For my platformer tile-based game I want to be able to load the game map from an image file. Consider the following 25x15 px .png (enlarged) representing some level: Assume that each specified ...
1
vote
1answer
53 views

SIMD and Inverse Tangent

I'm calculating spherical UV coordinates in a loop, trying to get GCC to vectorize the code. Here's a compile-able example of what it looks like. ...
1
vote
2answers
2k views

Surface creation algorithm using points cloud

I am looking for a realtime algorithm to create a 2D mesh using points. But I am quite confused. It seems that Delaunay triangulation can help me create mesh using point clouds, but Meta-balls seems ...
1
vote
0answers
30 views

Bullet Physics stops detecting collision after a few steps

Let me start off by saying that the usage of Bullet here is slightly unconventional. I'm writing a server emulator for a game, and the server is only keeping track of the triggers, players and enemies....
0
votes
0answers
20 views

How to static link modules using static variable constructor?

I'm trying to make my game engine supports both static and shared linked modules. Basically I have a CREATE_MODULE macro that have 2 implementations. This is based on Unreal's method. ...
0
votes
1answer
101 views

Need help with a C26495 warning and E0513 error in a C++ SFML class

I'm currently learning to program a game with the SFML library.I dugged up a bunch of SFML tutorials on Youtube and found a really good one by 'Suraj Sharma': https://www.youtube.com/channel/...
0
votes
1answer
50 views

Unreal C++ Detecting new Key Down during current Key Hold

I am currently working on a combat system and I wanted to be able to have key combos to execute combat moves and such, and I am detecting key input type as well for example, if the key is tapped, or ...
0
votes
1answer
35 views

Recalculating normals on a tesselated cubed sphere with heightmap applied

I'm learning about the graphics pipeline using C++, HLSL and DirectX 11 for my course. I'm currently tesselating a cubed sphere with an applied height map. My issue is figuring out how to recalculate ...
0
votes
0answers
6 views

Explicitly Loading a Ogre3D DLL wrapper with OgreMainStatic.lib linked crashes when loading a mesh with CreateEntity

I have a Ogre3D 1.7.x DLL wrapper project that explicitly loads Ogre functions and works ok using the OgreMain.dll + D3D9 Renderer plugin.dll which loads a mesh without any problems. This is my setup: ...
1
vote
0answers
70 views

Trying to Rotate terrain

I'm new to OpenGL and don't really know how to rotate a terrain. For my graphics class, I have a project I need to do that is making a tire using OpenGL and work that we done in class (my framework is ...
1
vote
1answer
510 views

OpenGL Water reflection seems to follow camera yaw and pitch

I'm attempting to add reflective water to my procedural terrain. I've got it to a point which seems like it's reflecting however when I move the camera left/right/up/down the reflections move with it. ...
0
votes
1answer
62 views

Four (4) color channel png has black “background”

I am experimenting with C++ code to load a png file, using libpng. When I get to the color data in the file, I load it into a std::vector. I have found that the ...
0
votes
0answers
46 views

Need help with a 'Read access violation' exception in an SFML/C++ project:

I'm recently learning to make a 2d game in SFML using a tutorial series on youtube by Suraj Sharma(Video 57): https://www.youtube.com/watch?v=kwd_AVCkvXE&list=PL6xSOsbVA1ebkU66okpi-KViAO8_9DJKg&...
0
votes
0answers
12 views

How to use mip mapping with SpriteBatch in DirectXTK

For a C++ .dll project of ours, I am able to render different sprites from a spritesheet into a texture using DirectXTKs SpriteBatch() method. But then, we came to notice that the sprites start to ...
4
votes
1answer
213 views

How can I create a templated function to add components to their necessary containers using an ECS system?

I had implemented a basic ECS system and was then informed that it should be changed as each system should not directly store their required components. I have created a ...
1
vote
1answer
51 views

C++ SDL2:2D tilemap with every tile has its own behavior

I am working on 2D tile based game. I want to render the tilemap from a file but every tile has its own behavior for example: magmablock : poorlava(); slimeblock : knockback(); I have this ...
0
votes
1answer
36 views

How to use TEnumAsByte Unreal 4.22

The problem I am attempting to use a TEnumAsByte in one of my class headers: I get compilation errors: Code sample I have included everything relevant to the ...
0
votes
1answer
39 views

how do i call variables inside headers from cpp?

i'm making a game right now so i want to make a main menu, so i made a header that will contain all the variables, like images, settings and, other things. (i will only talk about the images) the ...
0
votes
1answer
38 views

Unreal MouseWheelAxis negative axis does not work

Would like to avoid using separate action mappings i.e. MouseWheelUp and MouseWheelDown for a system I'm developing. I noticed <...
4
votes
1answer
134 views

Easing towards stepped value

I'm currently developing this rhythm game in lua (on top of a c++ engine) and I'm having trouble keeping a steady playhead position for the song currently playing. The playhead position that the ...