People who code: we want your input. Take the 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
vote
1answer
70 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
27 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
52 views

How do I make the game appear in the window?

...
1
vote
0answers
14 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
22 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
20 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
59 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
33 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
25 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
38 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
10 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
8 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
29 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
57 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
52 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
14 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
29 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
60 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
31 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
35 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
23 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
113 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
45 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
28 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
39 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
25 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
49 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
80 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
26 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
21 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
23 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
20 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
8 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
69 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
16 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 ...
0
votes
1answer
63 views

How would I go about coloring marching cubes terrain?

I'm making a game with marching cubes terrain (I know very original idea) and I don't exactly know how to color it. I have a system to do it, I just need to know how to interpolate it where it's not ...
1
vote
0answers
24 views

Creating an external tool to edit Unreal project optimization settings

INTRO I am creating a C++ app that will help users to set up optimization settings in the Unreal game engine. I want to let the program make all this work on its own. This application is being written ...
0
votes
0answers
22 views

PBR GLSL shader incorrect lighting. Half being shaded

I have been following the tutorial at LearnopenGL to implement physically based rendering into my Vulkan game engine, and have gotten the following incorrect lighting results: The light is overhead, ...
1
vote
0answers
16 views

How to create a joint, where the rotation of one object is relative to the other?

I would like to create a top down view scene, with one rectangle (top) is on top of an other (base). There is a joint, where ...
0
votes
0answers
34 views

What does glBlendFunc(GL_DST_COLOR, GL_ZERO); mean?

I need to write a description about a filter method I made but I don't know what glBlendFunc(GL_DST_COLOR, GL_ZERO); means.
0
votes
0answers
18 views

Chess Programming - Principal Variation and Transposition Tables

Right now I am currently trying to implement a principal variation search algorithm for my chess engine (C++) as well as a transposition table. I have looked at various sources online and have become ...
0
votes
0answers
12 views

Help trying to use TinySoundFont library with SDL_Mixer

I'm using SDL_Mixer in my project currently and I found the following library to play sounds from a soundfont https://github.com/schellingb/TinySoundFont I tried this example which use the normal ...
0
votes
2answers
58 views

Tower Defense: Sorting Algorithm with multiple weights (enemy AI)

I'm writing a sorting algorithm for a tower defense mobile game. As a quick synopsis, I have a "tower" that can shoot at incoming threats that are within X distance from the base of the ...
0
votes
2answers
58 views

How to vertically flip a DDS texture on import?

I have a program capable of rendering 3D graphics using Direct3D11 and it is currently compatible with two different texture formats, TGA and DDS. The code to read and load a TGA texture in memory I'm ...
0
votes
0answers
34 views

Single Array Texture, multiple wrap modes

I have a array texture of which I would like some of its sub-images have wrap modes of GL_REPEAT and others to be ...
0
votes
1answer
47 views

Distance between moving, rotated rectangles in snake game

I am trying to implement basic Snake game with movement based on timestep. For now I've got something along those lines: Update function: ...
0
votes
1answer
62 views

How do I contiguously store and iterate over ECS components in C++?

I'm writing an entity component system and want to store each type of component separately and contiguously in memory in a way that's easy to iterate over. Component...

1
2 3 4 5
81