Skip to main content

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

Need help on structuring my window class and game class

I'm trying to create a simple-ish game/engine/framework thing in C++, and I'm trying to come up with my own code instead of following a tutorial so I can learn to do it in a freer and more hands-on ...
whitecloth's user avatar
0 votes
0 answers
45 views

Issue raycasting when direction vector nears zero in x and z axis

I am working on a voxel game right now in OpenGL and working on implementing raycasting so I can pick blocks in my world. So far what I have created works quite well except for when the x or z axis ...
stubbie's user avatar
1 vote
1 answer
92 views

IDXGIFactory::CreateSwapChain() vs D3D11CreateDeviceAndSwapChain - When to use which for making a swap chain?

I'm following a bunch of tutorial series on how to set up Direct3D 11 for 3D rendering, I'm focusing on the swap chain part for now. The main tutorial series I am following is the one by PardCode on ...
whitecloth's user avatar
1 vote
2 answers
95 views

Relation between an object and its renderer

Recently I decided to start optimizing code in the game development field. I found this pacman project on github a good starting point: https://github.com/LucaFeggi/PacMan_SDL/tree/main I found a lot ...
X Y's user avatar
  • 111
0 votes
0 answers
41 views

How to make intersections between road splines at runtime in Unreal Engine 5?

I’m working on a project like the game Cities: Skylines. I’ve been developing a spline-based road system and it successfully creates street curves at runtime. The current problem is how to model ...
starixx studio's user avatar
1 vote
1 answer
89 views

Octree Query - Frustum Search and Recursive Vector Inserts

Brief I have spent probably the last year thinking about implementing an Octree data structure into my C++ game engine project for scene management and frustum culling of lights and meshes. Right now ...
Sharpie's user avatar
  • 41
0 votes
0 answers
9 views

Get Points Inside Staticmesh

I am working with UE5 and want to do simulations using Lidar Point Clouds Plugin. i am building a plugin but am pretty new to C++. I want to detect points of a Pointcloudactor that overlap with ...
Emin's user avatar
  • 1
1 vote
0 answers
45 views

Fixed timestep graphics jitter

I'm trying to implement the https://gafferongames.com/post/fix_your_timestep article but I have jitter on the position interpolation. video of the problem I have the following PhysX manager class ...
Mike F's user avatar
  • 103
2 votes
0 answers
40 views

Error while compiling Godot for ARM64 from source

I tried to compile Godot from source. But it is throwing an error. I followed this tutorial: https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_linuxbsd.html#doc-...
Nabir14's user avatar
  • 43
0 votes
1 answer
64 views

How to create a SIMPLE Skybox using OpenGL and SDL

As the title is saying I'm trying to make a simple skybox to learn how it works. Using, of course OpenGL and SDL. I have tried read some sites, here are them: link 1 link 2 link 3. None of them were ...
ガブリエル Gabriel's user avatar
1 vote
0 answers
26 views

Why couldn't I see my cube, and why is my mouse cursor acting weird?

...
Abdul Sadek's user avatar
0 votes
0 answers
23 views

How to get X and Y pixels of a Image in SDL2?

I am trying to create a Voxel Space Engine In SDL2 C++. However the tutorial I am following reads the X and Y pixels of the heightmap image. I can't find a way to do this. I am following this tutorial:...
Nabir14's user avatar
  • 43
0 votes
0 answers
32 views

Converting voxels into polygons taking into account the colors

I have code to convert voxels to polygons: ...
Het Best's user avatar
1 vote
1 answer
64 views

Strange scaling on my textures when they are upscaled or zoomed into

I am having a strange issue with my sprites, which is kind of difficult to describe, but hopefully the attached images will illustrate. I have drawn two 1 pixel lines on my sprite to help with this, ...
starrider's user avatar
1 vote
1 answer
55 views

Help me understand magic numbers in Chaos Vehicle plugin's torque calculation

I'm trying to understand the logic implemented in the Chaos Vehicle plugin. I need your help with following points: 1. Torque conversion If I’m not wrong then the brake torque unit is Nm, and ...
Yumyum's user avatar
  • 11
2 votes
1 answer
158 views

9 Slicing in OpenGL, want to have the center of the texture repeat instead of stretch

I have some sprites in my game, mostly though not entirely UI related, that I would like to be able to scale to different sizes without warping the borders of the sprite. Looking around I was able to ...
starrider's user avatar
0 votes
0 answers
12 views

Can't access to widget second time

I have a AScoreboardWidget ScoreboardWidget.h ...
EzioMercer's user avatar
0 votes
0 answers
57 views

Box2d into opengl/opengl es?

I recently learned a little bit of OpenGL through learnopengl.com. I've got through the window, gone through the triangle, then shaders along with interpolation, textures, and now transform. When I ...
Bobby Neal's user avatar
0 votes
0 answers
17 views

What difference does it make when to update the position of a component?

I'm trying to update the position of one of background parts. The goal is to move the most left background part to the right side of most right background part when it reach the some point (in my case ...
EzioMercer's user avatar
1 vote
0 answers
60 views

Sweep and Prune algorithm performance

I just managed to implement my Sweep and Prune algorithm together with AABB and it's working correctly in the first axis (I haven't implemented second and third yet to complete the collision detection)...
Zoler1337's user avatar
1 vote
2 answers
79 views

Missing faces at ends of voxel chunks

I'm having problems generating faces in a chunk in OpenGL C++. For example, when I generate faces, they are generated correctly but always at the end of the chunks some faces are not generated. ...
FandoraStudio's user avatar
1 vote
0 answers
135 views

How to use screen space coordinate of the mouse to set a model position in game?

I'm trying to make a movement system in my game where you click the mouse and your model moves towards where you clicked on the landscape, my understanding is the normalized screen coords go from [-1,...
jade22's user avatar
  • 11
0 votes
0 answers
20 views

How to set matrices for different objects, in OpenGL?

Not sure how to do it, since I'm only seeing one instance of matrix-use drawn (only one of the objects has an energy bar): ...
Valtsuh's user avatar
  • 139
1 vote
2 answers
102 views

2D Zoom to mouse point

So I'm trying to create a zoom function for my 2D camera. The best result I've got so far is: But something still feels off, and I just can't seem to pinpoint it. My code currently, which simply ...
Valtsuh's user avatar
  • 139
0 votes
0 answers
26 views

Problems with compiling with llvm and gcc, while trying to link external libraries to EngineCore.lib and finally linking core to EngineEditor.exe

Help me I Cherno's followed game engine series and branched to add 3D capabilities. I am having issues while linking libraries, at first I just wanted to share Game Engine code with friends, but not ...
Vxxssv's user avatar
  • 1
0 votes
0 answers
32 views

LOD selection issue

I have been developing an LOD algorithm similar to Nanite's style. I have been developing the algorithm using Vulkan .However, I encountered problems with LOD selection. It seems that the algorithm ...
Giuseppe's user avatar
0 votes
0 answers
37 views

How detect collision between object1[i] and object2[j] then do something with them in Box2D games?

I am making a simple game with Box2D and SDL2. I have GameObjects vectors for example: 1.vector of Enemy 2.vector of Bullets… in ContactListener class i can detect collision between enemyFixture and ...
Ryan Bairamzad's user avatar
0 votes
0 answers
59 views

How to resolve collision between wedge and AABB or capsule

I have a 3D world where all of my terrain uses AABBs as collision volumes (think minecraft, but not strictly cubes): I want to add wedge pieces as a terrain option. They'll have various slopes and be ...
Archduke's user avatar
0 votes
0 answers
30 views

Rendering sometimes blocks when updating Index Buffer at runtime

I developed a way to update my index buffer at run-time in Vulkan. Unfortunately, sometimes the rendering process blocks. I think that is caused by the update of the index buffer. The following code ...
Giuseppe's user avatar
1 vote
1 answer
80 views

Mouse coordinates to world space offsetting?

so i'm trying to make a mouse to world space function, and I seem to always end up with the rays cast offsetting. I've looked at numerous tutorials, tried numerous examples. Tried with ...
Valtsuh's user avatar
  • 139
1 vote
0 answers
40 views

How does Windows' Game controller properties connect to a joystick?

The situation: We need to use a new game controller (with a joystick only) hardware on Windows IoT. In the properties of "Game Controllers", moving the joystick is visible in the displayed ...
Justin Forgplay's user avatar
0 votes
0 answers
96 views

How to compute screen-space error for LOD selection?

I'm developing a LOD selection system and I would like to select a LOD level based on screen-space error. Could someone explain how I can accurately compute the screen-space error?
Giuseppe's user avatar
0 votes
1 answer
79 views

how to pass result of Compute Shader using UAV to Target View and render it in Direct3D11?

I'm trying to get a very basic Compute Shader to write to a Texture2D and render its result to screen. so far I have written this code to bind UAV to Texture2D and pass that to my Compute Shader. but ...
NotAlfred's user avatar
0 votes
1 answer
56 views

Update index buffer in Vulkan at run-time

What is the proper way to update at run-time the index buffer in Vulkan? Many thanks
Giuseppe's user avatar
0 votes
0 answers
31 views

Does an animation need to be loaded with a model?

I'm using assimp for my C++ rendering engine and I'm having difficulties with skeleton animations I've gone through a couple of tutorials/guides such as the skeletal animation chapter on learnopengl ...
Konjointed's user avatar
0 votes
1 answer
73 views

Sprite goes slow with some keys while withh others faster

I'm making a SDL and C++ game engine and I don't know where I'm failing. Here iss my code: Game.cpp ...
prestamo ordenador's user avatar
2 votes
2 answers
380 views

Should I be worried about reverse engineering revealing secrets?

I saw in the past that some games' mechanics have been revealed in details because of reverse engineering, and even the entire source code sometimes. I'm working on a C++ game with some deeper secret ...
Nécureil's user avatar
0 votes
3 answers
98 views

How to stop scenes from running before switching between them?

So, I've been working on a game dev library using C++ and SDL2 (to test the library out I'm making a Pong clone). And now I'm writing a Scene Manager which is going good, I can switch between scenes ...
smooll's user avatar
  • 1
0 votes
0 answers
46 views

Command Pattern or/and Event Handling porgramming paradigm?

I have created a dynamic library that contains all the tools I want my game executable to have. Additionally, I want to create a world editor/tools for my engine to be more user-friendly. I'm ...
Benzait Sofiane's user avatar
0 votes
1 answer
119 views

How do I code realistic rocket engine plumes in Unreal Engine 5.3.2

Right now, I am programming the engine plumes for a game called Spaceflight 3D, or basically a better version of KSP2 that my team of developers are working on. Mainly to be made for my company to ...
Lawn Hollander Lawn's user avatar
0 votes
0 answers
73 views

Matrices for OpenGL shaders

So I'm trying to figure out the model, view and projection matrices. I can, with some effort, find my drawings (3x3x3 structure of cubes) in 3D space and it looks like: The problem is, the cubes seem ...
Valtsuh's user avatar
  • 139
0 votes
2 answers
57 views

Custom matrix structure with OpenGL shaders

I have a MAT4 structure. ...
Valtsuh's user avatar
  • 139
0 votes
1 answer
37 views

OpenGL strange depth testing

Depth testing isn't working (hopefully the images below describe, I'll gladly describe more when asked) for me, and I can't seem to figure out why. GL initialization: ...
Valtsuh's user avatar
  • 139
0 votes
1 answer
85 views

OpenGL texture not working

So I'm setting up texture creationg like so, for the data 3 pixels, 1 red, 1 green and 1 blue pixel: ...
Valtsuh's user avatar
  • 139
0 votes
1 answer
124 views

getting navigation path points in unreal engine

I get an Exception when executing this code: ...
mleu's user avatar
  • 13
0 votes
0 answers
36 views

Breakout Game Ball Reflection after hitting paddle

I am working on a Breakout game. My requirements are when the ball hit the paddle in the center it goes straight up regardless of the direction it was coming from, then for the left and right it ...
Balaaj Raza's user avatar
0 votes
0 answers
62 views

SDL2 Events how to avoid monolithic control statement?

I'm using SDL2 in my game engine and I'm trying to figure out how I can prevent having a monolithic control statement like this: ...
Konjointed's user avatar
0 votes
0 answers
121 views

gdExtension C++ failed to load gdexample.gdextension in Godot 4.1

I have followed the guidelines carefully on how to use gdExtension with c++ from the official site GDExtension with C++ Everything else seems okay but when I launched the Godot 4.1 editor, this error ...
javascript's user avatar
0 votes
1 answer
100 views

Singletons as presented in Game Engine Architecture by Jason Gregory

I am reading the amazing Game Engine Architecture 3rd edition by Jason Gregory, but I have trouble understanding the singleton part, more particularly the part dealing with subsystem start/shutdown... ...
Benzait Sofiane's user avatar
0 votes
0 answers
51 views

Software rendering - perspective correct texturemapping

I studied source code of an old game from the 90s and saw a function for perspective correct triangle texture mapping. In this function ymin and ...
black4joss's user avatar

1
2 3 4 5
87