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
0answers
24 views

MMORPG UE4 Tooling

I'm building an mmorpg using UE4 on the client side with a custom server solution. My target is to build server only data in UE4 editor. Define spawn points Define spawn areas etc I've struggled a ...
0
votes
1answer
56 views

Do external graphics cards for laptops help decrease compilation time? [closed]

Can modern compilers use the power of a graphics card to shorten compilation time? Or is this solely based on the CPU and RAM? For example, can GCC utilize an external graphics card connected via a ...
-1
votes
2answers
82 views

Trying To Restart My Shooting Arrow With Overlap

I am trying to restart my shooting arrow if the arrow hits the roof but the bool is not changing [and giving a] cast failed [error] this is my shooter character shooting arrow ...
1
vote
1answer
44 views

Timestep Jittering

I've been trying to implement the famous Fix your timestep in C++ and SDL2 using a simple example. I have a square that moves around on the screen but I cannot understand why it keeps jittering/...
-2
votes
0answers
45 views

Moving camera with keyboard (WASD) in OpenGL (GLFW)

I want to move camera with keyboard in OpenGL. I followed this tutorial, but I have no idea how can I use them. This is my code: ...
0
votes
0answers
21 views

How to make a camera zoom effect in SDL2?

I'm trying to make an pseudo-camera in my SDL2 game. The WASD input movement is already working fine (it's a camera that points aims on the center of the target), but i'm struggling on making an zoom ...
-1
votes
0answers
50 views

box2d.Fixture contact

In box2d, there is a class b2ContactListener, consisting of virtual functions and kind of allowing you to override what will be executed when collisions are detected. I have redefined the functions as ...
0
votes
1answer
55 views

How do I correctly use userData in Box2d?

Many guides used userData. But with the source of Box2d I have, I don't see the SetUserData functions in the code as I see them in the guides. After understanding ...
0
votes
0answers
17 views

How can I bind fields of USTRUCT with text fields in widget UMG?

I have USTRUCT object. Its fields are filled in c++ code from a JSON object and I need to bind its fields with the content of text fields in a widget. So the flow of my program should be like this: ...
0
votes
1answer
53 views

Cannot access private member declared in class

I have a class definition as such: ...
0
votes
0answers
35 views

Advice on Multi-Threading Vertex Buffers in Vulkan (or any api)

I have managed to multithread everything in my voxel engine besides two vkCmdCopyBuffer() calls that constantly update a single massive vertex and index buffer using an array of thousands of regions, ...
-2
votes
1answer
39 views

Cant compile raylib project with Physac

I'm trying to learn how to use raylib with physac, however I'm quite new to using a c++ compiler and after a few hours trying to get a minimal example working, I came here seeking your help. here is ...
0
votes
1answer
27 views

Keeping two triangles with different scale attached during rotation

I'm making a simple Lunar Lander clone. The ship is a triangle, and I'm trying to draw the exhaust fumes of the ship. I'm wondering how to draw the exhaust so it's always relative to the ship. I'm ...
1
vote
1answer
156 views

What is a efficient way for adding and removing vertices and indices in C++?

So I have this middle-large mesh that is composed from vertices and respective indices. At some point I need to add new ones and remove some. But that brings me into trouble. Because if I have, for ...
0
votes
3answers
118 views

Are there conventions on what exactly to log in a game?

I am currently developing a game in C++, using SDL2. For logging, I wrote this Log class: Log.h ...
0
votes
2answers
22 views

Getting cameras from World (Unreal Engine) to set up a static camera only game

I'm afraid I have another Unreal related question. I'm trying to use ACharacter for my characters but the game uses ONLY static cameras (ie. they shouldn't even ...
0
votes
0answers
15 views

How to sort segments by their angle relative to the specific angle range?

Problem I'm trying to implement a simple algorithm that will sort segments by their angle based on the given angle range. Each of these segments has one common end. These sorted segments will be later ...
0
votes
1answer
17 views
0
votes
0answers
12 views

Add some randomness to the velocity when a ball bounces using UProjectiile Movement Component

I've just started to learn Unreal Engine 4.26.2 with C++. I’m developing a clone of Arkanoid and I’m using UProjectile Movement Component to move the ball. When the ball hit something it always ...
0
votes
0answers
28 views
2
votes
2answers
95 views

How to orient a rectangular object, so when a sphere ( ball ) collision happens to redirect it towards a point?

I have a rectangular object and a ball ( sphere ) in 3D and would like to orient the rectangular object in such way that when a collision with the ball and the object happens, to redirect the ball ...
0
votes
1answer
14 views

How to access a Material Editor node from a script?

Is it possible to access a node from the Material Editor from a C++ script? I'd like to be able to change the value of 'Mulitply' from a script.
0
votes
0answers
32 views

OpenGL : std140 alignment and uint64_t arrays

I have a problem but I can't figure out what is happenning (I think that there is an alignment problem...), so in my OpenGL application I use bindless textures which handles are sent to the shader via ...
1
vote
1answer
55 views

Is it a good idea to swap between a lot of different shader states during runtime?

What I'm trying to do is create a specific shader states(depthstencil, blend, and rasterizer)...
1
vote
1answer
33 views

Can't create Render Target with CreateDxgiSurfaceRenderTarget

I'm trying to create ID2D1RenderTarget to be used for writing text with DirectWrite. I tried two methods but can't get it working, both yield "The parameter is incorrect" error code. In the ...
2
votes
1answer
139 views

Text Only Dungeon Crawler game. Hardcoding Maps vs Generating Map Data externally?

I am trying to make a text-only dungeon crawler game. The general structure for the game is in place (ie. a 'Level' is a 16x16 grid of 'Rooms'). ...
1
vote
0answers
43 views

Is there any easier workaround for calling RPCs from actors that are not owned by a net connection?

Currently, I have a component that is attached to my player controller and some actors in the game world. Whenever I need to send an RPC I pass my player controller component reference to the actor in ...
0
votes
0answers
52 views

Lifecycle for UI objects

I'm currently developing UI features using OpenGL. The initial way I structured all source code is that before accessing the game loop (rendering functions, event processing...) I define the UI ...
1
vote
1answer
70 views

How to get the RGB color values of a clicked pixel on a rendered image in SDL2?

In the same vein as this question and this question, I recently ran into a problem in my C++/SDL2 game architecture where I needed to get the R,G,B values from a clicked pixel in an image on the ...
1
vote
1answer
84 views

Orthographic projection not showing a triangle

I just want to draw a simple triangle using GL_LINES primitive with orthographic projection matrix. This is my vertices... ...
0
votes
0answers
18 views

how to code in unity in C++ linux

I would like to avoid writing code in C# as much as possible. Unity only just recently has support for linux, and I'd like to code with C++ in unity if it is possible. How does this setup go about? ...
0
votes
0answers
17 views

How to add vec2 for UV for texture mapping when using indices to build cube

I am trying to apply texture mapping to my cubes but are unsure on how to proceed. Current I am using indices to avoid having to repeat vec3s to make a cube and a vertex array of the points and their ...
0
votes
2answers
88 views

When does a "frame" start and end?

Here is the main loop that I currently have (and it does work perfectly): ...
1
vote
0answers
39 views

Avoiding jitter when snapping diagonal movement to a pixel grid

Whats the best way to be rendering the locations of objects in box2D in such a way that there no stuttering on movement beyond 8-directions. I'm looking to have object strictly snap to the pixels but ...
0
votes
1answer
38 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
44 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
46 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
42 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
42 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
186 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 ...
3
votes
1answer
164 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 ...
5
votes
1answer
199 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
41 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
103 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
66 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
46 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
112 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
36 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
66 views

How do I make the game appear in the window?

...
2
votes
0answers
22 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 ...

1
2 3 4 5
82