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

In Unreal why is it safe to access a UTexture2D's properties from the render thread despite the documentation stating this is not allowed?

I've been trying to implement something that will update textures on the render thread from a background thread. And from what I've read of the unreal engine documentation you should never access a ...
1
vote
0answers
28 views

How can a system similar to Dwarf Fortress' legends mode be implemented?

In Dwarf Fortress, nearly everything that happens during world generation is logged and viewable in legends mode. An XML file containing that information can be exported and loaded into a utility such ...
0
votes
0answers
24 views

Voxelizing a mesh using FAABB to get volume data

I want to solid-voxelize a mesh in c++ and get a volume data with faabb bounding and voxel array , this is my code but it's not working and I can't understand where it goes wrong. ...
0
votes
1answer
28 views

What is the signifigance of the Dot Product in World to Local Transformations?

Looking for help understanding why this World to Local Space function works. I'm working my way through Buckland's Programming Game AI By Example The following function is used in the book to convert ...
0
votes
0answers
46 views

Why Present(0,0) is removing first rendered object?

I have to render two objects, more exactly, same object twice, just to clarify, all my constant buffers are dynamics, created like whit this flags: ...
0
votes
0answers
20 views

3dsx.specs, ds_arm9.specs, and gba.specs are missing?

I am having problems getting devkitARM to work. It won't find the proper .specs files for me. I know indeed, that they don't exist in my installation of it. So when I try to compile a 'hello_world' ...
0
votes
0answers
31 views

Serializing object members within unordered_map and storing into binary file (C++)

I'm making a multiplayer game, the Server stores it's game world state as various std::unordered_map in a class called ServerWorldState. The server is composed by a single class called Game, which ...
0
votes
1answer
10 views

How to collect objects from map in blueprints

I have a plate with trigger(TriggerVolume) on it. When it overlapped cubes from map deleting. I've manually created references on cubes in blueprint to delete them but it seems very hard-coded. Is ...
0
votes
1answer
36 views

Should 3D transformations be represented by a 4x4 matrix or a 3x4 matrix?

Since 3D transformations are represented by 4x4 homogeneous matrices we know that their last row is always (0,0,0,1), and as such the behavior of this final row is implied so long as we know whether ...
0
votes
0answers
13 views

How to implement two sided view in directx 11?

I'm searching for the way to implement two sided view in directx 11, the best answer I found is this: enter link description here I tested to do that: initialize backface culling to CCW (counter ...
0
votes
0answers
19 views

C++ OpenGL Arcball controlls 'flipping direction' after crossing any of the axes

hello graphics developer... I want to implement something like the mouse rotation controls found in 3D modelling software like MeshLab Here is the code in the mouse callback: ...
0
votes
1answer
22 views

How to update different constant buffers for different vertices in vertex buffer?

Lets say I have vertices and indices for Box and Sphere and I put them into one vertex buffer. But if I want to use different constant buffers for each of the figures, how would I do that? As I ...
0
votes
0answers
23 views

How can I draw filled triangles with the illusion of color?

So I have used the code of this website for drawing filled triangles. But I would like to improve my game by adding the illusion of color. Well sadly I made my game for the monochrome Nokia 5110 ...
0
votes
1answer
36 views

how to track point on object with rotation

I'm working on a top down shooter in C++ and need to have a fire point on the player and npc's so that when they rotate bullets come out of the fire point and not the actual position here's what i ...
0
votes
0answers
51 views

How to remotely host my c++ game server on Ubuntu?

I made a server for a 3D multiplayer game I'm working on. The game is currently functional to a point where I know multiplayer gameplay is possible locally on Windows. IDE: Visual Studio 2019 Target ...
0
votes
0answers
30 views

How to set up node data for Pathfinding algorithm in 2D platformer?

I've been doing a lot of research into the A* pathfinding algorithm and I'm trying to incorporate it into my program. This is not a game that I created so I have no control over the frames. However, I ...
0
votes
1answer
79 views

How to differentiate between object types and roles?

I have a base class Object, and depending on how the object must behave on the scene, I have multiple abstract "role" classes, that inherits virtually from ...
0
votes
0answers
19 views

How to make 2D particle explosion

So as in the title I want to know how I accomplish an explosion effect with particles. So far I am able to generate particles in a random position and they just fade out. What do I need to make the ...
0
votes
0answers
16 views

UE4 double linked list and queue does not work with UPROPERTY() macro

Could somebody explain why Unreal's TDoubleLinkedList and TQueue (and maybe some other containers, I'm not sure) does not want to compile with UPROPERTY() macro? Without macro all is OK. However, the ...
0
votes
0answers
35 views

Some maths about camera in 3D

So after finishing a 2d game for my school project, I decided to dive into 3d world by using raylib instead of Unity. Raylib does provide a simple implementation of 3d camera without you doing maths, ...
0
votes
1answer
59 views

Chunk Culling system causes deltatime to slow down

I am making a 2D top-down game in C++ and the graphics library SFML. I have designed a chunk system by myself and have successfully made it so that when a chunk is off-screen, it isn't rendered, to ...
22
votes
1answer
4k views

Optimization of rendering of cube world

I have a world made of many cubes (like in Minecraft), they have only color (not texture). I am rendering them using OpenGL 3.3 core profile (GLFW3, GLAD, GLM). I am already have done some ...
0
votes
1answer
31 views

Collision doesn't work in isometric view

I have problems with collision detection in my isometric game - the collision is on a different spot then the actual object is, its like the SDL_Rect is somewhere else then the object itself which is ...
0
votes
0answers
25 views

Return different components by name in entity component system

I'm working on an entity component system but I'm having trouble with the editor. Components take the form of structs with this formula Component healthComponent; This works fine when you know what ...
0
votes
0answers
19 views

Align object according to camera rotation so it stays fixed

I'm trying to implements a bullet whose orientation aligns with the free movement of my first person camera. I got the following camera code from learnopengl.com: ...
0
votes
0answers
21 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
14 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
11 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
0answers
7 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
35 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
35 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
20 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
13 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
24 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
13 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
69 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
41 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
74 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
21 views

same 8bit created surface resulting in a different pitch value

Given ...
0
votes
1answer
59 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
68 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
27 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
53 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
55 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
209 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
13 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
47 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
37 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
13 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
32 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. ...

1
2 3 4 5
78