Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
29 views

Objects lose their individual positions and rotations when imported from FBX using Assimp

I am a newbie trying to learn DX11. I successfully put my obj model into the program by using assimp. Unfortunately, I cannot load the same model in fbx format correctly (both of them were exported ...
1
vote
0answers
31 views

Collision detection stop movement

I am making a simple first person 3D game in OpenGL with C++. I am just wondering on how you make an object stop moving when it collides with another object. This is what I am using for detecting ...
2
votes
0answers
44 views

Synchronizing transformation of a Rect class between CPU and GPU

I implemented a Rect class in my custom game engine that utilizes openGL. I decided to approach the whole Rect class design like ...
0
votes
0answers
34 views

rotate sprite without stretching

I am attempting to rotate the sprites in my game, but they get stretched whenever it happens. I know that it is due to the screen not being square, but I can not figure out the correct way to ...
0
votes
0answers
21 views

mingw “undefined reference to” error when compile

i tried to move to minGW to compile my program since i am trying to use a more recent OpenMP version since visual studio uses the 2.0 one, i was planning on using #pragma omp target{} to pass the ...
3
votes
1answer
159 views

In game development, what aspects to consider when choosing a 32-bit architecture over a 64-bit architecture?

I was developing a graphics engine from scratch using Direct3D11 and some APIs, but I stumbled in a situation where it would beneficial to me to use a certain library, but it's binaries are only ...
2
votes
1answer
45 views

Drawing OpenGL camera frustum

I am trying to display camera frustum in my OpenGL application. I calculate the vertices of the frustum pyramid using reverse projection from screen space to world space. The camera uses perspective ...
4
votes
1answer
168 views

In a chess simulator, how to efficiently determine checkmate?

I'm working on a small C++ chess simulator game for the first time, and I have a bit of a programming dilemma. I have searched for similar questions on this site and StackOverflow, but can't find a ...
0
votes
0answers
36 views

How to design Smooth Game Play using the Windows message translator and message dispatch loops?

In gameplay, my sprite will pause briefly when I change directions. I need help correcting this issue. Any suggestions are welcome. I have a constants header that has ...
0
votes
0answers
91 views

My jump never stops

I'm making a short jump test in SFML. However I have a problem: whenever the jump button is pressed the character will jump but will not fall down, he will keep going higher. However, in the beginning ...
0
votes
1answer
46 views

Why is transform matrix order is reversed in my Scene graph implementation?

I have researched this a lot and so far all the examples, tutorials etc always use the following order: Scale * Rotate * Translate but for some reason this order must always be backwards in my Scene ...
1
vote
0answers
43 views

What are good ways to enable one class to access many other classes? [closed]

I'm writing a simple 2d tilemap engine using C++ and SDL2. Question: I have a tile class that contains the data of a tile: ...
1
vote
1answer
94 views

How do game engines enforce global, engine-specific coordinate systems?

In Unreal, the 3D coordinate system is defined as a right-handed, X-forward, Y-left, Z-up frame of reference; but, the default 3D coordinate system for, say, DirectX is a left-handed, X-right, Y-up, Z-...
0
votes
0answers
33 views

Dual Contouring - Eliminating sharp edges

I want to remove the sharp edges (Cubic looks) of Dual contouring. It currently looks like this: This is what I get when I try to implement QEF: ...
0
votes
1answer
60 views

How do I make the game appear in the window?

...
1
vote
0answers
16 views

How to fix UV Mapping Bleed in UE4 [closed]

Images of the issue, code, and logs Howdy, I’m creating a cube using ProceduralMeshComponent in UE4 and I’ve run into the issue of creating my UV Maps. I’m completely stuck on the issue, as it looks ...
0
votes
0answers
36 views

How to use raylib on Manjaro?

I wanna use raylib and I just installed Manjaro (KDE) on my laptop. If I recall correctly I'm supposed to Install raylib from the AUR. And that's what I did. I installed this: https://archlinux.org/...
0
votes
0answers
25 views

Box2D calculate distance in certain direction

I'm writing simple AI genetic learning for a 2d car. To do so I need sensors surrounding my car so I can get distance to closest obstacle in every direction. (Picture 1) Picture 1: I need every of the ...
0
votes
1answer
70 views

Storing 2D animation frames and sharing them between objects

I store 2D animation frames in some class. But the problem is that when I want to create multiple objects for example I want to spawn explosion or enemy ...
0
votes
1answer
41 views

Event type and SDL_QUIT are incompatible

I'm following the Lazy Foo SDL2 tutorials, and I've run into a problem when trying to poll for events. While I'm polling for the events, the event type and SDL_QUIT ...
0
votes
0answers
33 views

SDL2 - Updating part of a texture is slower than updating all of it

I'm programing a kind of cellular automaton in which each pixel is an automaton. I'm using a SDL2 streaming texture with the SDL_LockTexture() and ...
1
vote
1answer
42 views

Add inertia to Pawn movement

I've just started to learn Unreal Engine 4.26.2 while developing an Atari Pong clone. This is how I have implemented the Paddle's movement (but this implementation doesn't accelerate or has inertia): <...
0
votes
0answers
12 views

How to use AttachComponentToComponent in C++?

Anyone can explain why using the blueprint is more efficient in this case, I mean when I attach the hairs using blueprint, the hairs is welded with headsocket in editor and in play mode, but with C++ ...
0
votes
0answers
9 views

Unreal Engine Visual Studio 2019 C++ - Could not open source file CoreMinimal.h [duplicate]

I'm trying to follow a YouTube tutorial and I've ran into this (Severity Code Description Project File Line Suppression State Error (active) E1696 cannot open source file "...
0
votes
2answers
34 views

How to set the hair_mesh to follow the animation?

How to set the hair mesh to follow the animation? I am trying this. ...
0
votes
0answers
60 views

Game loop design

I'm developing a simple Win game. Here is my 2 similar implementations of the game loop (in c++): approach #1: ...
2
votes
1answer
62 views

How to pass parameters to a Blueprint function called from C++?

I have found this piece of code showing how to call a blueprint function from C++: ...
0
votes
0answers
15 views

PlaySoundAtLocation plays sound after some delay

I’m developing the Pong game to learn Unreal Engine 4.26 using C++. I use this code in the class’ constructor to load the sound: ...
1
vote
0answers
32 views

How would I implement a level transition when reaching a cave in Raylib?

I am the developer of an upcoming 2d/3dRPG. I have a simple scene setup where there is a bridge over some acid and a cave entrance-like thing that I want to change the level with. I have used C and C++...
0
votes
1answer
64 views

Why the mouse doesn't move in mouse-look feature of RPG/FPS games?

Description The mouse look (or free look, i.e., move the mouse to change the view/camera) is common in RPG and FPS games. In my cloud game project, I tried to achieve this feature. Before programming, ...
0
votes
0answers
39 views

Why are my models and images are just blank in raylib?

I am using Raylib after trying SFML, and I have a playable level, albeit just a plane that you can walk on. I'm trying to add a skybox and nothing shows up, even when using the example code that they ...
1
vote
0answers
39 views

How to properly delete unwanted models

I am implementing bullets into my game, and each bullet has a lifetime. Whenever the bullet has existed for a set amount of time or collides with an object, the bullet should be deleted. I implemented ...
0
votes
0answers
41 views

How to use SetBoneRotationByName() to rotate a single bone in a armature?

I am very excited to finally be learning Unreal engine development! But I have been working with Unreal editor for only the past couple of days but am having trouble understand how to rotate or ...
3
votes
1answer
200 views

What is GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS?

I am a beginner in OpenGL. I am learning about textures in OpenGL. What I don't understand is how to determine how many texture units are in the GPU. I heard someone said that you can see how many ...
0
votes
0answers
22 views

I'm implementing a sort of isosurface extraction and theres a bunch of holes

i'm implementing a isosurface extraction algorithm losely based on dual contouring but theres a bunch of holes it looks like what i want though other than that can you look at code and fix it maybe it'...
1
vote
0answers
46 views

How to reduce code duplication in a cross-platform renderer without tying the interface to one specific API?

I'm working on a game engine as a fun project over the spring+summer. I've decided that to allow myself to explore rendering APIs I'm unfamiliar with, and force myself to write reusable code, I'd ...
1
vote
0answers
30 views

How can I create a heightmap for ocean surface simulation?

I am working on a game that is based on boats fighiting each other. The game is finished but due to some license incopatibilities, I have to change how I simulate the surface of the sea. What I used ...
1
vote
0answers
43 views

Parsing Sprites from Spritesheet

How can I parse a spritesheet consisting of scattered sprites with different sizes, like this example and return the (x, y) and ...
0
votes
1answer
29 views

What is the difference between libraries like C++/PDCurses and SFML?

I have read that PDCurses is a library that can be used to create 2D games however SFML is also a library but they are not in the same category I presume according to what I have read: "The ...
1
vote
1answer
55 views

Godot C++ NativeScript version not rendering multimesh instance whereas GDScript version does

I am new to Godot. I am aiming to create a RTS game with 10's of thousands of units and for it to run smoothly. So I'm looking to use GDNative C++ with the Visual Server to handle updating and moving ...
1
vote
1answer
136 views

Delta Time FPS with SDL 2 in C++

I have tried achieving a good delta time and fps counter over the last few days, read and watched a lot about it, but still can't seem to get it to work. Here is an example: ...
0
votes
0answers
27 views

self extending factory: return type and serialization

I'm trying to implement a better management for the objects in my game project. With input from another thread here on S.O., I decided to implement different collections for different types for better ...
0
votes
0answers
23 views

How to a select a single 3D object out of multiple objects using mouse click and move it using mouse drag in OpenGL

I am rendering multiple 3d objects on the screen but i want to select one particular object by clicking on it and then move it using mouse drag but i cant figure it how to do it because on clicking ...
1
vote
1answer
30 views

Using UPawnMovementComponent to control a Pawn with Keyboard sharing code between Pawns

I've just started to learn Unreal and reading the tutorial Components and Collisions I have found that they use the UPawnMovementComponent to control their ...
0
votes
1answer
28 views

Why Query Only fires OnComponentHit? It supposes to fires only Overlap events

I've just started to develop with Unreal Engine 4.26.2 and I've been for five days trying to understand how collision works. I'm developing a Pong game, and I'm trying to make that the Ball bounces ...
0
votes
0answers
9 views

Get GPU Visualizer widget info

I want to read some info from the GPU Visualizer widget and use it in my plugin, but I have no idea how. I guess this code is responsible for running the ProfileGPU ...
0
votes
1answer
72 views

How to pass data between game states?

Lately I've been using game state stack implementation from a book SFML Game Development and I've stumbled upon a problem with passing data between states. In this implementation State constructors ...
0
votes
0answers
24 views

Assertion Failed: TextureRHI - Texture Casting Errors (UE4)

I am taking a pointer to a UTexture2D asset "MyTexture2D", and casting it to an array of FColor using the following: ...
0
votes
0answers
15 views

Skinning on simple model doesn't work as expected

I have created a simple application to make skinning work with OpenGL. so I want to share with my vertex shader: ...
1
vote
1answer
29 views

Problems with collisions (using vector of instances)

I wrote a for loop to check every instance of the class Wall, only the the last instance in the vector properly works hybrid.h ...

1
2 3 4 5
81