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

Structuring in-game menus

I'm working on a multiplayer RPG using only C++ and SDL2. I've already made the main menu and a map editor, and I'm preparing to make the actual game. The main menu and map editor were easy to ...
0
votes
0answers
12 views

Directx 12 : Synchronisation between two processes

i have created two application. One application is rendering a texture off-screen with unlimited frame rate present option. The second application is reading what APP1 is rendering from graphic ...
0
votes
0answers
16 views

UE4 Multiplayer how to replicate Player name in lobby

I've been working on a little 1V1 snipper project to try and get a better grip on the replication and the game framework of unreal engine. So after the core gameplay, I'm trying to make a lobby ...
0
votes
1answer
34 views

Rotate Sprite towards mouse cursor SDL

I have trouble to make my sprite(Arrow) to point at the position of my mouse cursor but i don't get the Right results. I've tried this: ...
0
votes
1answer
58 views

VAO not showing

My VAO is simply not showing up and i'm not sure if my matrices are wrong or if the shader is wrong… Please have a look a see what is wrong… My code is big so i'll post the essential. ...
0
votes
1answer
85 views

Programming Test for a job in Game Dev - expected levels of documentation etc

If this is the wrong place to be asking this - please let me know and I'll happily ask it somewhere else! I am completing a C++ Proficiency test for a "Junior Engine Programmer" role at a game studio ...
0
votes
0answers
29 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
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
vote
1answer
36 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 ...
1
vote
0answers
61 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
1answer
32 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
42 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 ...
2
votes
1answer
95 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 ...
-2
votes
1answer
107 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 ...
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 ...
-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
1answer
88 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 ...
1
vote
1answer
76 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
36 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
0answers
44 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 ...
-1
votes
0answers
45 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 ...
0
votes
2answers
67 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
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
39 views

How do i draw sprite on fixture position?

...
1
vote
2answers
104 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 ...
0
votes
2answers
69 views

Assertion b2Assert(m_bodyCount > 0) showing an error

I have the following code for deleting a Box2D body: ...
-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: ...
0
votes
1answer
38 views

Cant find a way to set fps for sf::Time

...
0
votes
0answers
13 views

How to get normals in the FBX SDK?

I'm working with FBX SDK and I'm trying to get normals of my model but I have no idea of how to do it and I dind't find anything on Google. I am using C++. I hope you'll be able to help me !
1
vote
1answer
109 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 ...
2
votes
1answer
126 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 ...
0
votes
1answer
70 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: ...
3
votes
1answer
192 views

C++ Wrapper class for raw pointer to an SDL_Texture

First time in game dev, so go easy on me. I understand it's senseless to copy textures, but I'm trying to see this from a copy/move perspective since there is a lot of that going on in my code and in ...
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, ...
0
votes
0answers
21 views

Libnoise bounding box - from spherical to planar

I'm trying to convert a bounding box inside a spherical map (equirectangular image as a result of Libnoise/c++) into a planar projection, but I can't find the correct algorithm for it and I'm not good ...
0
votes
0answers
28 views

what exactly is the logic behind 6502 and precise clock cycle emulation?

Key questions to consider based on page 10 of this document: http://archive.6502.org/datasheets/rockwell_r650x_r651x.pdf What does page 10 imply by "Add 1 to N if page boundary is crossed"? What ...
0
votes
2answers
65 views

UE4 Code Project is not showing sub folders created within C++ Classes Folder even though they exist

These were my steps. Created an empty code project in UDK4. The editor starts up. On the left bottom you have: If you try to right click on C++ Classes, Or select [Add New] while having C++ Classes ...
0
votes
1answer
59 views

C++:Segmentation fault (core dumped) while creating gameobject

i made a small code to debug and i get this error player inherit from gameobject code ...
1
vote
1answer
104 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 * ...
0
votes
0answers
49 views

Cyclone LED gaming code HOW TO HELP?

I am very new to programming. For a project I decided to make a game of cyclone using some LEDs,a push button, and a raspberry pi. I researched how to at least start on the game, but the problem that ...
-1
votes
1answer
54 views

C++: passing gameobject as a parameter and then into vector

firstly iam used to java and new to c++ so maybe this will looks a noob's question i will explain this and give a pseudo code and then c++ just so you can understand me i have a player class which ...
2
votes
0answers
102 views

Structure for a strategy game

I am making a strategy game like Age of Empires. It's a pretty big project and I need a clear game structure. I have defined a Game_Object class with variables ...
0
votes
1answer
50 views

Could not load PNG in SDL2?

I have three image files, one is Techs.png, one is Techs.gif and one is Techs.bmp. I have used SDL_image 2.0.5 and SDL 2. When I load the image of Techs.gif and Techs.bmp, there is no error, but when ...
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. ...
4
votes
1answer
326 views

What Situations is Saving a Game to Main Memory for?

I've been reading through Unreal's 'Saving and Loading' guide: Link Within, they present a capability to save a game to main memory rather than secondary storage: I haven't found any information on ...
-2
votes
2answers
94 views

Loading the map from an image file in C++

For my platformer tile-based game I want to be able to load the game map from an image file. Consider the following 25x15 px .png (enlarged) representing some level: Assume that each specified ...
1
vote
1answer
85 views

SIMD and Inverse Tangent

I'm calculating spherical UV coordinates in a loop, trying to get GCC to vectorize the code. Here's a compile-able example of what it looks like. ...
1
vote
0answers
35 views

Bullet Physics stops detecting collision after a few steps

Let me start off by saying that the usage of Bullet here is slightly unconventional. I'm writing a server emulator for a game, and the server is only keeping track of the triggers, players and enemies....