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
35 views

Extensible 2D Rendering with ECS Architecture

I am currently creating a 2D game/game engine using an ECS architecture. Currently I have a renderer_2d system which is a function that takes all ...
-1
votes
2answers
92 views

Collision detection between transformed meshes (not primitives)

I know questions related to collision detection have been asked multiple times, but I find all of them like this and this depend on the assumption that I have some sort of measurement of the object ...
0
votes
0answers
37 views

Opengl. A single texture is applied to all my objects. glTextureStorage2D Error faced

I can't seem to figure out why a single texture is applied to all my objects. I have three objects - fence, ground and cone but they get weirdly placed textures or a single texture on all of them. ...
-2
votes
0answers
41 views

How to Shift Rows Down and Clear Them (Tetris C++)

I'm working on a version of Tetris in C++ for a university class. However, I'm having trouble with shifting rows down and clearing them once they're full. We're supposed to be using the structures ...
-1
votes
0answers
49 views

How to build cross-platform for iOS and other platforms with a single graphics API? [closed]

I was able to support Windows and Android with my C++ game by using: sdl2, sdl2_net, assimp, freetype, imgui, glm and I'm planning to use OpenGL for Windows and OpenGL ES for Android, but my problem ...
0
votes
1answer
22 views

How to change uwidget alignment on/after construction?

Have no idea how to align/realign uwidgets via c++. I have a following widget structure: UButton->UOverlay->UImage. Have to make UOverlay to HFill and VFill the UButton
0
votes
1answer
11 views

UWidget::SynchronizeProperties() is not being called on in editor property change

I have to change the children list every time the enum variable property is changed from widget editor. None of the functions I've tried so far seem to have worked (virtual void OnEndEditByDesigner(); ...
0
votes
0answers
26 views

Arcball camera panning - how to apply mouse coordinates to position regardless of orientation

I have an Arcball camera with panning and rotation working properly; however, panning does not work as intended after rotation is happening. Here are my panning and rotation functions: ...
0
votes
0answers
63 views

What is the most performant way for a game engine to poll gamecontrollers?

I am working on a game engine, and currently I hesitate on this decision. I developed a library that allows Dualsense and Dualshock4 devices to be used in the engine. XBox Support is made possible via ...
-1
votes
1answer
120 views

How do game loading screens work?

I have successfully developed a 2D game. I display sequential introduction images then load the start screen after that of course I load the game level in a single thread, it is a basic functional ...
0
votes
1answer
51 views

I can't render faces properly in my DirectX11 project

For some reason, only back-faces are rendering, even if I set the rasterizer and stencil buffer and state to any values. Setting D3D11_CULL_NONE, ...
0
votes
0answers
30 views

Unreal Engine - Looping Procedural Mesh Terrain

We are building a procedural voxel terrain based game and have been doing really well. However we have hit a challenge that we have half the solution for. We need to figure out how to loop the terrain ...
-1
votes
1answer
54 views

What is wrong with my terrain lighting?

I've just implemented a simple algorithm to calculate terrain vertex normals and I'm using diffuse and ambient light currently, but for some reason the squares that make up my terrain are visible when ...
0
votes
0answers
21 views

Need an approach for mounting turrets

I'm working on a game with the ability to customize the type of turrets on your starship. My question is how would I go about positioning the turret mesh at the hardpoint locations. Do I need to ...
0
votes
1answer
68 views

Find those points lying on a circle from a ton of points

Given a 2d scene and 10,000 players with coordinates in the scene, I want to implement a function, the input is a circle with the center coords and its radius, the output is those players that lie on ...
0
votes
0answers
51 views

FBX SDK Transformation/Scaling

I am using the FBX SDK to load 3d models into my rendering application. I can successfully traverse the object hierarchy and pull vertex data for the individual scene meshes and display the meshes in ...
1
vote
1answer
46 views

Transforming 3D coordinates to 2D isometric position

I'm trying to render isometric maps, my final goal is to render scenes that resembles Snake Rattle 'n' Roll: So I started by rendering cubes: For now I have an array with a collection of 3D vectors ...
0
votes
0answers
33 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
61 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
83 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 ...
0
votes
1answer
52 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/...
0
votes
0answers
35 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 ...
0
votes
1answer
75 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
20 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
88 views

Cannot access private member declared in class

I have a class definition as such: ...
0
votes
0answers
41 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
75 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
29 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
168 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
123 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
40 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
27 views
0
votes
0answers
14 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 ...
1
vote
0answers
113 views
2
votes
2answers
96 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
51 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 ...
0
votes
1answer
58 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
50 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 ...
1
vote
1answer
146 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
1answer
111 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
242 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
19 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
20 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
94 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
49 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
49 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 ...
0
votes
0answers
50 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 ...
1
vote
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 ...

1
2 3 4 5
82