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

Tilemap collision in Pure ECS?

I'm currently making a 2D topdown dungeon crawler using pure ECS and Data Oriented Design. So I only use structs of arrays for all my components. I have now added tilemap generation, but was wondering ...
0
votes
2answers
156 views
0
votes
1answer
68 views

2D Topdown Shooter - Line of sight based purely on angle and rotation

In a game I'm working on, enemies constantly rotate around as they move around the map. I want them to only shoot the player if they're within a field of view. This is the function header: ...
1
vote
1answer
518 views

Creating a real loading screen between levels in Unreal Engine 4

I'm trying to create a loading screen to pop up between levels in Unreal Engine 4. I want to have a traditional loading screen such as the loading screen in Skyrim, where the player presses play and ...
0
votes
1answer
28 views

How to set root signatures specified in HLSL in my command list?

From Microsoft Docs, I can specify the root signature of my shader in HLSL. How do I use it though? Since at the beginning of the command list, root signature is undefined. I need to use ...
0
votes
0answers
24 views

Godot native c++

I want to add java native interface cpp to be compiled to .so files in the apk in godot android export. Basically add android native jni c++ to godot. My first gamedev stackexchange question.
0
votes
1answer
87 views

I can't make the cube map to use shadow mapping - or it seems so

Basically, I'm following tutorials as I'm very new to OpenGL. I managed to perform shadow mapping towards just one direction, meaning I created 2D texture depth map. Now with omnidirectional shadow ...
1
vote
1answer
31 views

Making a box character in UE4, not a capsule

I want to make a character for a Breakout game that is a kind of cube. From the instructions from Unreal it appears I need to create a 'Character' blueprint. But when i do this, it comes with ...
0
votes
0answers
28 views

Execute Timer Events of another Blueprint from the C++ UE4

I am having problem and it's about a week now that I still can't figure out how to get it right. It seems that I can't run any functions from the blueprints that contain timers at all. I have a ...
-1
votes
1answer
816 views

Volumetric Lighting/Light Shafts in DirectX

So currently I am trying to implement Light Shafts into my DirectX Engine. I read the Nvidia GPU Gems Article (https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-13-...
1
vote
0answers
59 views

What Type Does One Cast the Result of “get_function_address” to in Order to Call the Function Within a C++ DLL?

According to the game maker documentation for dll manipulation: get_function_address('function_name') Returns the address of a GameMaker function. This can be passed to DLL's so the can call ...
0
votes
2answers
77 views

What is the most efficient way to trigger an action based on proximity?

I am developing a 3rd person platformer that entails a grapple hook system. This grapple hook system relies on a series of 'grapple-able' points. I would like these points to shine every so often. ...
0
votes
0answers
40 views

2D Spatial Hashing in C++ Causing Game to run more Slowly

I'm trying to use spatial hashing to speed up collision detection in my game. I believe spatial hashing is better suited for my game than quadtrees, because I have lots of fast-moving objects in my ...
1
vote
2answers
103 views

What is the proper way of handling resolution and size units on a 2D game?

So I started to learn SDL2 and I want to make a simple 2D game. Now when I render a texture I have to specify in pixels the size of the element I want to draw and also the position in pixels on the ...
-2
votes
1answer
103 views

How can I draw filled triangles in C++?

VERY IMPORTANT NOTE: Im trying to fill a triangle. I have already made the 3D part. Sorry if this wasn't understandable. I'm currently trying to create a simple 3D-Engine. Well, I have successfully ...
0
votes
1answer
34 views

Accessing the Properties of an object already in Scene in Unreal Engine using C++

I am trying to learn more about raycasting in C++ and am trying to implement raycasts in a mini third-person game I am creating. In order to shoot a raycast, I first need to determine its starting ...
2
votes
1answer
93 views

Game Either Runs Poorly or at Different Speeds

I'm making a simple 2D shooter game using C++ and SDL2. For my main game loop, I used the code from the famous Fix Your Timestep article. The problem is that, because I'm using a fixed delta time, the ...
1
vote
0answers
455 views

Libnoise producing completely random noise

I am using libnoise in C++ taken and I have some problems with getting coherent noise. I mean, the noise produced now are completely random and it doesn't look like a noise. Here's the image produced ...
0
votes
1answer
24 views

Why do I get syntax error: identifier FHttpRequestPtr

I'm trying to add HTTP requests to my game and everything compiles fine until I try to set up a delegate for when the response is ready. Adding this function causes the compiler to fail for syntax ...
11
votes
3answers
3k views

Why is it possible to encounter a texture coordinate greater than 1 or less than 0

I'm studying a text about texture mapping and in the preparing to draw session, I read: Define the texture wrapping ...
0
votes
1answer
51 views

Typical Point Light Flow?

A Quick Note This question assumes you have some knowledge about the overall rendering process and do not need clarification on rendering objects with HLSL and a <...
-2
votes
0answers
40 views

How do I bind a bone vector to a glBuffer?

I want to shred the bone with the vector of weight. However, running the c++ and the GLSL code below, I get an error: glBufferData import problem vertex shader :S How should ...
0
votes
2answers
138 views

Game movement in 2D SFML game

I am making simple 2D game, imagine it as 2D Minecraft where you can dig blocks and build other things. Currently I am struggling with movement. I have none experience in game development, but I am ...
1
vote
1answer
103 views

The A * algorithm in the map has many moving objects

I am using the A * algorithm for my game, it is a kind of Isometric map with lots of tiles. If all the game objects are trees, rocks, houses and only one game object is a moving hero, the A * ...
7
votes
1answer
399 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: ...
0
votes
1answer
86 views

Game states and events

I'm writting a game in C++ and I'm struggling with getting events and game states work together. By game states I mean something like this ...
2
votes
1answer
121 views

'Destroyed Actors' and 'Save Games'

Background Our team is creating an adventure platformer, and I have been tasked with creating a Save Game system. Our game features the usual progression systems, and is relatively linear. Approach ...
3
votes
1answer
553 views

Specular Light not working (Phong Lighting)

There seems to be a problem with my current Phong Shading implementation. I have been using the per fragment approach. The specular highlight aspect of the technique is not rendering as it should, as ...
1
vote
2answers
51 views

Problem with rendering a quad from four lines

I am having a problem with rendering a quad in opengl via 4 lines (5 vertices via GL_LINE_STRIP). The rendering is generally working fine in terms of connecting the lines into a quad. The problem is, ...
-1
votes
0answers
44 views

Why does not checking for something before using it *sometimes* crashes the editor with an unhandled expection?

This has happened a couple of time and I just want to understand what's going on. Most of the times I can use GetController() without any problems, but sometimes I need to check for it first, ...
1
vote
0answers
52 views

How can I apply my camera to all graphics objects?

Is there a way to have the camera be applied to all objects? Can you have the camera effect objects that where made with glVertex3f(); This is the fourth time I ...
-2
votes
1answer
71 views

Why is my map not drawing properly?

My code compiles fine but for some reason, I get this white background in my window. what am I doing wrong? I want to draw my map (sorry, there is a lot of code). Here is my debugged window image: ...
1
vote
1answer
75 views

How do I render a word in the middle of the screen using FreeType and OpenGL?

I'm following this tutorial series on making a simple 2D clone of the classic Breakout game, but its author doesn't mention how to render a whole word or sentence in the middle of the screen. He ...
0
votes
1answer
35 views

Unable to create OpenGL window in SDL2

I am currently working on a C++ + SDL2 game engine and I am stuck on a problem. The problem is that whenever I pass SDL_WINDOW_OPENGL to ...
0
votes
1answer
335 views

SFML 2.5 on Ubuntu 18.04 - cannot open shared object file: No such file or directory

I'm trying to run an example code with SFML 2.5 on Ubuntu, but without success. I'm using: VSCode 1.27.0 with the Easy C++ Projects extension on Ubuntu 18.04. The build/run output keep saying that ...
0
votes
1answer
189 views

Offset on camera following object that accelerates

I have camera a that is actively following an object (a plane) from behind. This object can accelerate or decelerate. I would like to have a camera offset when I move the plane, so it doesn't look so ...
0
votes
0answers
43 views

Can I use plain old C++ objects and smart pointers in UE4?

I'm a big fan of reusable code and want to make use of code that I integrate into UE4 projects outside of the engine as well. I am new to UE4 dev, so this is my first attempt of weaving the UObject ...
0
votes
1answer
44 views

Update TTF Texture for Score

I have a little problem with Updating my Score with TTF. Im a neewbie so dont blame me :P I Try to Update my Score But the Buffer Get too small after a while and my Game Crashes. ...
0
votes
2answers
203 views

How can I represent a 2d UI?

So, I wanted to start building a desktop application, which is of course with an interface, and I thought that OpenGL would be best. The problem is, once I started following TheChernoProject's ...
2
votes
3answers
804 views

How to get `Label::createWithTTF` to support RTL languages such as Arabic

Firstly, I'm using Cocos2d-x v3.6, Visual Studio 2013 uses(UTF-8 without signature option) and ...
1
vote
1answer
534 views

Convert a transformation matrix from world-space to camera-space using Eigen

I have a transformation matrix, in world space. I need to convert it to local(camera) space. I have done the reverse of this (Local - to - world) using: ...
0
votes
2answers
64 views

Adding a map without recompiling

I am creating a maze game in c++. I have a class that is used to create the walls with positioning and collision. I want the user to have the capability to include the header files needed for making ...
0
votes
1answer
207 views

DirectX 11 Sprite Alpha (Invalid? + Bad Quality)

i have a bug with a texture font. This is the texture file in photoshop: This is the result i am getting: The alpha from 0 and 1 shows weird artifacts as the final result, alongside the low quality ...
5
votes
1answer
279 views

How to generate a multiplier map for radiosity

I am following this tutorial: here I am at the part where you are creating a hemicube. I have got the code to render the scene into a texture and therfore an array. Now how can I generate a so-called ...
2
votes
3answers
217 views

How can I favour vertical travel before horizontal with my A* path-finding heuristic?

I'm writing an AI of a 'police car' that 'patrols' over a 2d grid. Right now, the patrol car randomly selects a destination, finds a path between it's current intersection and the destination ...
0
votes
1answer
34 views

C++ property is none when accessed in bp

I have a class in C++ that I want to access in BP. It appears to be fine in C++ but in BP I get Accessed None errors when I try to use it in BP. Here is the class declaration that I am trying to use ...
0
votes
1answer
1k views

Change Pawn movement speed

I'm newbie in Unreal development and I don't know how to move my pawn faster. By the way, I'm using Unreal 4.16. I'm developing Pong game and I have this method to move the pawn: ...
0
votes
1answer
361 views

How to return reference from BlueprintImplementableEvent?

I've got a C++ component and I want to have function which will be implemented in Blueprint like this: ...
0
votes
1answer
39 views
4
votes
2answers
1k views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen. I am using Projection, View and Transformation matrices but am unable to get anything to the screen. Main loop ...