Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
-1 votes
0 answers
33 views

is there a way to read assets at compile time instead of runtime?

is there a way to read assets at compile time instead of runtime?
jade22's user avatar
  • 1
0 votes
1 answer
21 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
42 views

Looking to turn a c++ code for a game which runs on console only into a proper game [closed]

Hi so I made a basic card game for my cs100 project which runs on console only. Here's the link: https://github.com/theunknownsexy/Thulla-card-game I want to convert this game into a proper game, with ...
monish kumar's user avatar
0 votes
0 answers
23 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
60 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
193 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
0 answers
42 views

When declaring a new member variable in Player class, they spawn off-screen bug [closed]

Development environment: VSCode 1.89.1 Windows 11 C++ 11 Compiler: g++ 8.3.0, make 3.81 So I am relatively new to C++, but this is just plain weird. I am making a game with base C++ using SDL. I ...
John Francis's user avatar
0 votes
3 answers
83 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 ...
reallySmooll's user avatar
0 votes
0 answers
33 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
55 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
64 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
  • 79
0 votes
2 answers
38 views

Custom matrix structure with OpenGL shaders

I have a MAT4 structure. ...
Valtsuh's user avatar
  • 79
0 votes
1 answer
34 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
  • 79
0 votes
1 answer
49 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
  • 79
0 votes
1 answer
30 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
26 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
51 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
51 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
80 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
41 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 ...
black4's user avatar
  • 205
0 votes
0 answers
76 views

SSAO Looks Like Depth Buffer

I have problem with ssao, i'm using vulkan and follow Sascha Willems vulkan ssao example here: https://github.com/SaschaWillems/Vulkan/blob/master/examples/ssao/ssao.cpp my ssao result looks exactly ...
Karim Hamdallah's user avatar
0 votes
0 answers
70 views

What do you do with SDL2 events?

I have the typical/basic event loop for SDL2 and I'm a little confused on what to do with them or how to handle them or I guess more specifically how should I get the data from these events (e.g ...
Konjointed's user avatar
0 votes
1 answer
24 views

When does SFML deal with user input

I have an SFML programme using window.setFramerateLimit() to determine the time step of the game. I have a game loop that looks like this: ...
Momus's user avatar
  • 1
1 vote
1 answer
231 views

How do programmers distribute their games from custom game engines?

I am currently reading tons of books about game engine, real time rendering, animation, physics... but I could not find any description of how game developers who built their game with their own game ...
Benzait Sofiane's user avatar
0 votes
0 answers
39 views

Screen coordinates in OpenGL shader

I have triangle in screen coordinates, and I have resolution 800x600. How I can put this vertex buffer (triangle with screen coordinates) into OpenGL shader and draw this triangle? Inside shader ...
black4's user avatar
  • 205
0 votes
0 answers
44 views

What is the best way to load models with support for multiple textures per mesh?

Currently, I have a model loader heavily inspired by the one made in LearnOpenGL, which works fine when loading regular models. I made a simple cube in Blender, exported it as an OBJ and I'm able to ...
KleberPF's user avatar
1 vote
1 answer
46 views

Blinding flash. Set background color when creating new window

Using GLFW to create the main window Example c++ ...
Blindman67's user avatar
0 votes
0 answers
53 views

Why doesn't my Raycast detect AABB collision?

I have the following struct that calculates Raycasting: ...
Luigi Istratescu's user avatar
0 votes
2 answers
620 views

What’s the benefit of breaking code down into other classes? [closed]

Sorry if this isn’t the proper spot to ask, but something I struggle to wrap my head around is the benefit of breaking down code into smaller pieces on the surface it seems to make sense I think you ...
Konjointed's user avatar
1 vote
1 answer
58 views

I want to change the direction of my platform from z direction to y direction alternatively

So basically, I want my platform to move first on the z axis from start position to end position, and then from ...
Ken's user avatar
  • 13
1 vote
1 answer
30 views

Set Textures DX12

...
black4's user avatar
  • 205
0 votes
1 answer
56 views

Mouse Ray Picking: Z-Coordinate of Projected vector (glm::unproject)

I've run into a curious issue when implementing ray picking in my game engine. It seems the Z coordinate of the Projected matrix has to be ever so slightly more than ...
Josh McCord's user avatar
-1 votes
1 answer
46 views

Shader compilation error

This is the begin of my vertex shader code: ...
black4's user avatar
  • 205
1 vote
0 answers
63 views

How to avoid/reduce code duplication in asset loading/caching with templates?

I'm working on an asset manager for my game engine, and I'm a bit stumped on how to use templates (and potentially inheritance) to reduce some code duplication. An asset requires 4 things: a container,...
Konjointed's user avatar
0 votes
0 answers
51 views

C++ how to load different assets within an asset manager?

I'm in the process of redoing my asset/resource manager currently I have load functions scattered throughout my code for example LoadMeshFromFile(), LoadTextureFromFile(), LoadShaderFromFile(), etc, ...
Konjointed's user avatar
0 votes
1 answer
65 views

How do I make my character jump, with a curve, in C++?

...
Nehal Chowdhury's user avatar
0 votes
0 answers
65 views

How to detect when console system time was changed since the game was last run, without a net connection?

As an example of the behaviour I want to implement in my game, look at Bloons TD 5 on the PS4/PS5 and its Daily Chest Reward. If you disconnect the internet and change the date and time and play the ...
CodeCamper's user avatar
0 votes
1 answer
40 views

How do Entity Component Systems work?

In the project I am working on, I recently ran into a problem of software architecture: I created a base entity class that displays a world object. Then I added functionality for the entity to have a ...
snow_owl's user avatar
0 votes
0 answers
26 views

Build Fails while building for cocos2d-x 3.17 on Ubuntu 22.04

While building the game (cocos2dx- 3.17 on ubuntu 22.04) it fails with below error - ...
user1897165's user avatar
0 votes
1 answer
86 views

Sanity Check on my Idea for an Event System for game

So, I recently started making a small game from scratch, with no engine used(I'm a beginner at this) and I want to create an event system of my own. I want to check if my general idea for it is okay(...
HavocKid's user avatar
0 votes
1 answer
95 views

encapsulation, structs and global variables?

I have worked on creating a gameloop and so far all of the code was inside a main.cpp file and I want to separate it into different files. Which caused several problems: My code is separated into 3 ...
snow_owl's user avatar
1 vote
0 answers
49 views

Old color attachments being used after resizing window

I have the following deferred rendering setup: The first render pass renders the scene to a fixed size image (2048x2048) from the directional light's point of view to one color attachment as a shadow ...
Symlink's user avatar
  • 133
1 vote
0 answers
72 views

How do I create a build from a custom Game Engine?

I have an custom Game Engine, made in C++ and made in Microsoft Visual Studio 2019. Currently, this Game Engine has a .sln with the following projects: TheGameEditor, which is the current entry point ...
JonathanCacay's user avatar
3 votes
5 answers
3k views

Is there any performance penalty to unsigned integer underflow?

Is there any performance penalty to unsigned integer underflow? Suppose I have a computation subtracting two unsigned integers (so underflow can happen if b > a),...
Qwert Yuiop's user avatar
0 votes
0 answers
30 views

CircleShape crashing program when defined as an instance variable

I am encountering a perplexing issue in my SFML game development where my program crashes instantly during runtime when I add a CircleShape as an instance variable ...
Julian42_74's user avatar
0 votes
0 answers
80 views

How to continue with Unreal engine after crash?

I know that it is possible to do it so that when the engine (and maybe the game) crashes, it does not close, and continues to work. Who knows how to do it? I know there are many ways to do something ...
grouptout's user avatar
  • 101
2 votes
2 answers
125 views

How do materials and shaders work in graphics programming?

I stumbled upon a few videos about shaders and materials from The Cherno and my understanding is that materials are this sort of input that a shader takes to calculate an output instead of hard coding ...
Konjointed's user avatar
0 votes
0 answers
94 views

Cmakelists.txt with sfml/glew/glm .exe doesn't work

I am working on a game in c++, i want to make a Cmakelists.txt file for build a .exe file. ...
Gaëtan S's user avatar
0 votes
0 answers
51 views

How to render two different meshlets at two different LODs in a Mesh Shader?

I would like to know how to render two different meshlet at two different LOD values. So, for example, I render the meshletA at LOD1 and I render the mesheletB at LOD2. Please let me know if this is ...
Giuseppe's user avatar
1 vote
1 answer
98 views

How do real time cutscenes work?

I want to code a real time cutscene editor in my engine but I couldn't find any pdf documents or websites explaining it in detail. Is the cinematic scene file loaded with instructions like ...
user23344561's user avatar

1
2 3 4 5
87