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

Creating an asset library accessible from all classes

The idea of what I'm trying to do is to create a class that will automatically pull in all of the assets needed using the ConstructorHelpers and store them in a library with IDs. Then from there, any ...
0
votes
0answers
16 views

How to check if line of sight is blocked by a sphere? [duplicate]

Well, I'm trying to check that both players can see each other, and their line of sight is not blocked by a sphere(point with radius) Here is a simple 2D visualization Here is my code template: <...
0
votes
0answers
124 views

The type or namespace name 'RigidBody2D' could not be found (are you missing a using directive or an assembly reference?) [duplicate]

using System.Collections; using System.Collections.Generic; using.UnityEngine; public class Player_Move_Proto : MonoBehaviour { public int playerSpeed = 10; public bool facingRight = true; ...
0
votes
1answer
22 views

How to get image component from blueprint in c++

I have a dialog screenwith character icon and I need to be able to set up this image in code. But I don't know how to access this Image component (I put material instances in it). .h ...
0
votes
0answers
69 views

Design decisions in building a 3D Rendering Engine using Vulkan in C++

I'm starting to learn the core concepts and features of the Vulkan API. I'm following the tutorials that can be found here: vulkan-tutorial. I'm at the point of getting ready to implement the code to ...
1
vote
0answers
37 views

Subtract a circle on a rectangle - OpenGL

I am writing a game using GLFW, GLEW, GLM and Bullet3 in C++. Its a Maze with holes. I am doing the floor with rectangles (wich is 2 GL_TRIANGLES). I want to make some woles (circles), to the ball ...
0
votes
0answers
43 views

OpenGL and multithreading in C++, GL_INVALID_OPERATION error. Array object is not active

I have two threads. My main thread handles all the OpenGL calls, and my second thread batches all the data together in std::vector and then passes the data back to the main thread. Absolutely nowhere ...
0
votes
0answers
55 views

How do I identify XInput devices using the RawInput API?

I've been following this RawInput tutorial for detecting game controllers that are attached to the system. I'm able to detect the gamepads, add them to the list of game controllers, and interpret ...
0
votes
0answers
25 views

Updating argument for a matrix every frame

Question is how to properly use continuously changing argument every frame. I have Class Shape, which have children Box, Sphere, etc..., I'll follow with Box example. Each of children have ...
0
votes
0answers
37 views

How would I combine FABRIK inverse kinematic results with a skeletal animation?

So, I've been working on a skeletal animation system in OpenGL/C++, and it's actually not coming along too badly. I can play animations, which I do by sending bone transform matrices to my animation ...
2
votes
1answer
184 views

How can I change the camera to work from an Y up system to a Z up

I am following the tutorial from learnopengl.com but it uses a Y-up system, but I would like to change it for a Z up system because I'm more used to it. I tried changing the up vector to be 1.0 on ...
0
votes
1answer
152 views

glfwCreateWindow function returning NULL

I am working on creating a game engine using GLFW. To begin, I set up a window class in C++ to test how making a window works. For some reason, when I call the glfwCreateWindow function, it returns ...
0
votes
1answer
88 views

I can't figure out whats wrong with my .obj file reader

I'm just loading a simple textured cube but it always has missing bits or warped textures. This is for directx 11 rendering by the way. Updated with more information. I think my problem is with ...
0
votes
1answer
30 views

same 8bit created surface resulting in a different pitch value

Given: ...
0
votes
1answer
127 views

Collision between a player and a solid block C++ SDL2

I am trying to implement a collision between a player and a solid e.g. a solid box. ...
0
votes
0answers
159 views

Creating a game on Linux with SDL and distributing it

TL, DR: Will I be able to get a single .exe file which will work smooth in a PC which does not have SDL or so installed ever. If not, how close will be the closest ...
0
votes
0answers
63 views

Scene management system for simple terraria-like game

I am building the engine for a terraria-like 2D sandbox game using SDL2. Currently, I am working on a scene management system. I was wondering if just having a single local variable in main called <...
2
votes
1answer
100 views

SDL2 Application RAM Usage

I am developing a game that uses SDL2, SDL2 Image & SDL2 TTF, while using clang compiler under Linux. When running it in release mode(compiler flags: -Wall -O3) there is a constant usage of about ...
0
votes
0answers
62 views

How to prevent rendered wound from sliding on moving character?

I am trying to display a rendered wound on the character, but I still can't figure out how to display it properly without sliding on character's body. I'm following this link on rendering the wounds ...
0
votes
4answers
301 views

How can I make my C++ game which installs its own DLL files?

Example: Minecraft is the same single .exe from the moment it's downloaded. Installations occur fairly quickly (very painless) for the selected version. My case: I have a C++ game which uses the ...
0
votes
0answers
17 views

Unreal : How to change the project 'Unreal Studio' Into a C++ project in Unreal Engine 4.20

I am afraid I am posting my problem in the wrong place, if so then please excuse me for that and would appreciate it if you can suggest another forum for my question apart from Unreal forum as I haven'...
0
votes
0answers
123 views

Discarding GLSL fragment values not working with stencil buffer

I am trying to make a system where I can outline sprites, but I can only get it to work correctly when I use a regular-shaped texture. Here is what an outlined regular texture looks like: However, ...
0
votes
1answer
46 views

How to sort scores and assign positions based on the scores?

I have three game objects each with an individual score. I was wondering how I should go about sorting these scores in ascending order. I want to also give these objects a position based on their ...
1
vote
0answers
19 views

My triangle disappears when multiplaying by my perspective projection matrix

Whenever I multiply my transformation matrix, which is passed to the shader via constant buffer, my triangle disappears. Here is the code for the passed matrix: ...
0
votes
0answers
68 views

C++ OpenGL: Object Components

I've been trying to make a barebones engine/game in VS C++ with OpenGL. So far it's worked well, I've managed to render two green triangles on the screen and can accelerate one using WASD input. ...
0
votes
0answers
80 views

How to draw lines in Directx12?

I want to draw line between two points (x1,y1,z1) (x2,y2,z2). I want to have possibility to change this line start and end point ...
0
votes
0answers
24 views

not able to connect client to server using SFML

i have made a simple pong game in C++ SFML ,but now to learn networking i want to make it multiplayer,SFML has networking methods but for the life of me i can't understand them,all i know is i have to ...
1
vote
2answers
791 views

Drawing outlines around 2D objects OpenGL

I am trying to draw an outline around any arbitrary object using OpenGL and shaders with a different color than the original object, while also retaining compatibility with alpha values <1. I am ...
0
votes
1answer
548 views

How to render in a imGui Window

I am learning OpenGL by glfw3 lib and I am using imgui to make a interesting application. However, I can not render what I want in a imgui window. I searched google and get below link: Render in a ...
0
votes
0answers
138 views

OnActorHit not calling hit function in Unreal Engine

I am trying to make a pong game in a 3D landscape. I want to make the ball bounce around the box or the Pong pad. But the ball just goes through the walls and pad, but the pad collides with the walls. ...
0
votes
1answer
27 views

Get FVector from Blueprint tick function

In my BluePrint Tick function for my character, I have a FVector that always changes, and in my C++ component, I want to get this changing FVector and use it in my C++ Tick function, is that possible ...
0
votes
1answer
410 views

How To Use Unity With C++?

In the C++ Visual Studio installer, there is an option Game Development With Unity. However, after selecting that, I didn't find ...
0
votes
1answer
46 views

Get BP FollowCamera Rotation and Location

I'm accessing my FollowCamera https://imgur.com/a/vbFagxg from my BluePrintCharacter class in my C++ code, with this following line : ...
0
votes
1answer
248 views

Bouncing Ball in c++

Background I've been making my own game from scratch. I've made my own collision system and there's a situation I'm having an issue with. Problem Pictured: a ball going in one direction and ...
0
votes
1answer
82 views

How to correctly reset vertex attributes after modification

I am trying to use the same vertex shader for two different use cases to preserve memory, but I am having issues where the modifications of one shader run are passed on to the next run, even after ...
0
votes
0answers
41 views

Is there an easy way to calculate the velocity of an object on a pendulum?

Want to have a rope travel to the mouse on m2 click and then act as the pivot of a pendulum, with the player being the bob. Used some math I don’t really understand to get the angle of the mouse ...
0
votes
1answer
31 views

How can i write automated tests for some SDL2 objects?

For eg having a class that is rendering something on the screen, could be even a point or a line if not an image or whatever. How is possible to write some tests for that class only? or just a small ...
0
votes
0answers
16 views

Does PerObjectConfig work when loading?

Is PerObjectConfig supposed to work when loading (not saving) the configuration? I did a lot of tries but never succedded to make it work. It worked for a per class basis when droping PerObjectConfig ...
5
votes
1answer
272 views

How do open world game engines allocate memory?

My troubles I've been trying to create a game engine but since I am not well experienced in C++ I am having trouble deciding on how to load new scenes efficiently level by level or just an open world. ...
0
votes
0answers
82 views

FreeType Library - Text on multiple lines

I am rendering text using the FreeType library allong with OpenGL, but say I want to render a long line of text, as seen in the ...
0
votes
1answer
30 views

My app crash using OpenAL but only in Release Mode

I'm building up a complete game engine so, basically, it integrate a sound system. The problem is that a line make me crash in my code. The strange thig is that my app crash ONLY when I compile using ...
0
votes
1answer
163 views

UE4. How to create a reference to the physical material asset (which I create in editor) in C++

Oftenly, when we want to assign asset to the particular component in C++ we write code like that: ...
1
vote
1answer
69 views

How do I initialise levels sequentially?

I have been learning opengl and I have made good progress over past few months. However I still struggle to understand game logic in C++, I am new to C++ too. Say I have this program. ...
1
vote
2answers
100 views

Third person and LineTracing C++

Problem I have a crosshair in the middle of the screen. I need to create a lineTrace that passes straight through this crosshair. As this is a third person game,...
1
vote
1answer
54 views

SDL window crashes when mouse goes below a certain point

I added code to check the rgb values of my surface, and whenever i call the function it seems to work fine! the only problem is that whenever the mouse goes under y = 400 the entire window crashes... ...
0
votes
0answers
64 views

OBB Frustrum Culling in Clip Space

I've been trying for a while to implement a frustum culling method using a per-computed AABB in object space and transforming it's corners into clip space. ...
0
votes
0answers
79 views

How can I 'pass' multiple render targets to an Unreal compute shader?

I need to access three things from a compute shader: the current textures being drawn to two render targets, as well as the previous output of the same compute shader. Essentially, I am trying to ...
0
votes
1answer
98 views

Debug in OpenGL & GLFW (version >= 4.3)

I try enable debug system in OpenGL with helps debug output in OpenGL version >= 4.3. My code: ...
0
votes
0answers
112 views

Help with Minecraft-like AABB-AABB collision detection and resolution

I am currently working on a Minecraft like game with OpenGL and C++. I've gotten as far as abstracting a Camera object and setting up movement and even defining basic gravity like simulations, but I ...
0
votes
1answer
432 views

Text Rendering using FreeType library not working correctly

I am currently implementing font rendering into my 3D game engine using the FreeType library. I have followed this tutorial: https://learnopengl.com/In-Practice/...

1 2 3
4
5
80