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
1 answer
54 views

Some objects only rendering half of the screen in snake game

I'm trying to make a basic snake game with OpenGL. I hold all the game object locations in a matrix called MAP. And when i render them, i operate the location info ...
  • 5
0 votes
1 answer
84 views

How to I modify a texture in OpenGL?

I am programming the editor for a RTS game and I have created the following: I am trying to modify the terrain so that it is not completely grassy. I am intending to add functionality so that I can ...
0 votes
1 answer
62 views

Input reaction is slow in two player snake game

i'm trying to make a two player console snake game. One of the snakes is controled by 'wasd' and other 'uhjk'. I have two function to get the keys getKEYS1() and <...
  • 5
0 votes
3 answers
29 views

Should the coordinates, and rotation angles of all the sprites be stored in variables?

I've learned that magic numbers are bad in code. However, should the coordinates, and rotation angles of all the sprites be stored in variables? Is the convention in game development to leave those ...
0 votes
1 answer
55 views

Is it possible to have shared data between shaders in GLSL that is loaded once?

For my game engine, I would like to be able to load all of the matrices (i.e. mvp, model, etc.) once per frame to save a bit of time, and have a set of uniforms that any shader can access by using ...
  • 1
0 votes
0 answers
157 views

ImGui Rendering Text Atlas instead of Framebuffer color texture

My application looks like this: I am using Dear ImGui for UI and wish to draw the frame buffer contents into a texture and then display that texture in an ImGui Window. I have followed the official ...
1 vote
1 answer
91 views

How do I modify parts of a texture on a quad?

I am programming a Real Time Strategy game, and I was wondering how I could retexture one part of a terrain quad to change a texture in the position where I click at. For example, if I clicked in the ...
-1 votes
1 answer
184 views

How to generate terrains in real time?

I am trying to make a terrain editor for my Empire Earth OpenGL clone engine. Are there any articles of how to generate terrains in real time? It would be cool if it had pseudocode, even cooler if it ...
0 votes
1 answer
36 views

Skipped function calls on Integer based frame data

I'm creating a basic animation system, where I call functions to change the rendered sprite and turn on hitboxes based on the current frame of the animation. For example, if (current_frame == 8), I ...
0 votes
0 answers
312 views

How can I use single uniform variables inside this Vulkan shader?

I have set up a shader like so. Instead of having all projection view model in a single ...
0 votes
0 answers
28 views

DirectX 12 Ultimate graphics sample generates a D3D12 "CBV Invalid Resource" error

Presently I'm working on updating a Windows 11 DX12 desktop app to take advantage of the technologies introduced by DX12 Ultimate (i.e. mesh shaders, VRS & DXR). All the official samples for ...
0 votes
0 answers
100 views

Movement diagonally is not consistent

I am making my own game and this is the first time i'm doing so. so I hope you can forgive stupid mistakes. Im making this in C++ and using the SDL2 framework. Currently, I have a character on my ...
0 votes
1 answer
43 views

Box2D bodies order inside the world

I'm working on a small platform game using box2d. When I create the game's objects I store them inside a vector. One for dynamic bodies and one for static bodies. ...
0 votes
1 answer
123 views

SDL2 and TmxLite (Tiled) (Reading the actual TILE data from the layer)

I am trying to make use of the Tiled Map Editor for my SDL2 projects. (By using the TMXLITE parser from Fallahn on Github) https://github.com/fallahn/tmxlite ...
0 votes
1 answer
59 views

Sometimes player moves too much

I'm working on a simple platform game. I have the player - a dynamic body, which moves by ApplyLinearImpulse. Generally it works very well, but sometimes the player ...
0 votes
1 answer
54 views

Box2D make dynamic body fixed on the y axes

I working on a game project using C++ with SMFL and Box2d. I'm basically recreating the game "Jump and Hover", a simple platform game. In the game ther is an platform thats "hovering&...
0 votes
2 answers
186 views

Game loop c++ implementation

I'm starting to develop some simple 3D game. The basic topic for a start is the game loop. There is a solution: ...
0 votes
1 answer
122 views

"Fix Your Time Step" Variable or Fixed Physics "timeStep" parameter for Step in Box2D?

I have seen multiple contradictory articles on this topic. Have been trying to implement the Should the function call ...
0 votes
1 answer
64 views

What would be a correct ID3D11Query design for occlusion testing?

I've tried looking for tutorials or samples related to the topic - but all that I could find are either scientific papers or vague posts on forums. As I understand it - I need to dedicate a whole pass ...
  • 1
0 votes
1 answer
80 views

Network racing game position interpolation jitters a lot

I'm making multiplayer racing game and I have problem with interpolating position.. Here's the sequence. Server simulate the world and send vehicle transform packet through UDP socket every 33ms to ...
  • 3
1 vote
1 answer
104 views

How to inherit from a custom node of a gdnative plugin, in gdnative?

Context I am developing a game in gdnative and I would like to design it in several "modules", where there would be: a main module for the core gameplay, a second module that I defined as a ...
0 votes
2 answers
93 views

X axis intersection with inverted Y axis coordinates

I'm making a visual clue for the player to know where (and more or less when) an asteroid is going to enter the screen. For this I'm using a triangle pointing at the incoming object and color ...
  • 13
0 votes
0 answers
39 views

How does using C# and C++ together with Unity affect efficiency?

I'm new to game dev and I'm looking to use Unity to create a phone game that will utilize neural networking. Obviously, putting neural networks in a mobile game presents a serious performance concern, ...
  • 1
1 vote
1 answer
31 views

Inconsistent behaviour from MonoObjects

I have embedded mono inside a c++ game engine to be used with my component system. Currently, I store the MonoObjects (instances of the components) using entt like this: ...
0 votes
1 answer
96 views

Function glBindBuffer access violation while executing

So I have a problem, I am calling some opengl frame buffer functions in my code but for some reason I get the error from the title. I am also calling many other opengl functions without any problems ...
0 votes
0 answers
33 views

DirectX 8 Win32 GUI Not Appearing/Flickering While Running

I am programming a game with DirectX 8, and I am trying to use the GUI options that are provided by the Win32 window that I am using. However, when I try to render a button or, in this case, a textbox ...
0 votes
1 answer
108 views

D3D11 CreateInputLayout error: CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE

I created a simple shader, and it compiled, but when using the vs as input layout, it failed with CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE. I don't know why. ...
0 votes
0 answers
33 views

SDL_BlitSurface() 'dstrect' - Not working as I expected

I am new to SDL but have used C++ a fair bit over the years. I'm struggling with displaying sprites with a scale. EG. Here I am trying to draw a grid of squares (ie. Tetris) but the source BMP is ...
0 votes
0 answers
32 views

Why does object not show?

I would like to tell about my home made exercising step to step with LWJGL and Java. But I don't understand why does matrix shut up? Transformation.java: ackage Example; ...
0 votes
1 answer
56 views

Detect if actors are inside another actor with custom shape

I have few actors with custom, non convex geometry (mesh) created using PxRigidActorExt::createExclusiveShape and a lot of actors with ...
  • 111
-2 votes
1 answer
1k views

Is it possible to make a 2D game using Unreal engine 5?

Is it true that UE5 can't be used to make a 2D game?
0 votes
1 answer
63 views

How can I determine which 2d entity was selected from a overlapping pile

I'm using C++ and SDL2 to learn about coding by creating a clone of a 2d tile-based game I enjoy. To setup my problem; There can be multiple items dropped on a tile by the player or other entities ...
0 votes
0 answers
51 views

How do I create a texture from a surface in DirectX 8?

I am making a game in DirectX 8 for a retrocomputing game contest. I am creating a Real Time Strategy game, and I am trying to make a minimap, which is merely an orthographic view of the terrain. When ...
1 vote
0 answers
157 views

Draw and render a sequence of 3D models with OpenGL

I have an application that will generate a 3D model for a dynamic 3D object (3D mesh + texture formatted as .obj file) at a time, so I end up getting a stream of 3D models (or 4D models?), and I want ...
  • 111
0 votes
0 answers
85 views

Projectile Aim Prediction with Target Acceleration and Bullet Deceleration Varying with Angle

I previously asked a question about this topic here, and now I'd want to review if the offered solutions worked, and then frame a new inquiry based on the difficulties and issues that resulted. So my ...
0 votes
1 answer
205 views

Intercept an accelerating object with a constant velocity projectile

I want to calculate the time that it takes to intercept a moving target "plane" with a projectile. For example I have two 3 dimensional vectors (2 locations in 3D space). ...
0 votes
1 answer
559 views

How to make object follow the mouse OpenGL?

I am trying to move an object on the 2D plane to follow the mouse position. I converted the mouse's XY and depth buffer value to world space coordinates, but the problem is that when I run the program,...
1 vote
0 answers
71 views

2D tilebased collision system

Hi i want to implement a collision system (something comparable to super mario) I would like it to have objects which can have any size (the hitbox of it) And it should be reasonably efficient (so ...
  • 11
0 votes
0 answers
157 views

unity native plugin: UnityPluginLoad is called but UnityPluginUnload is not?

I created a unity plugin which uses the low level native plugin interface, specifically UnityPluginLoad and UnityPluginUnLoad. Here is my result: When the dll is NOT marked with "Load on startup&...
0 votes
0 answers
118 views

Constructing a world ray from mouse coordinates

I've got the following c++ code. It produces a Ray from the mouse coordinates given. However the z coordinate is wrong, I expect it to be on the near plane of the ...
0 votes
0 answers
40 views

How can I disable gravity for an object after gravity has been applied previously?

I have a rigid body component which has a field named enableGravity. This flag is synchronized with Physx objects before simulation: ...
  • 189
0 votes
0 answers
82 views

Is there a way to call an exe from a unreal game

I'm making a turn based game Unreal with someone. They are writing the AI in C++. When it's the AI's turn I call the exe they have written. How should I call the .exe or is there a better way? I tried ...
1 vote
0 answers
126 views

What is the correct way to combine transforms together?

I have a type called transform in my game engine: ...
0 votes
1 answer
252 views

How do I corretly use a Direct X 12 Root Signature?

I know a Direct X 12 Root Signature tells Direct X 12 how to use the resources between the CPU and GPU, but I'm having a hard time using it. I tried using it before but it kept failing saying the ...
  • 1
0 votes
0 answers
252 views

Rotate the Camera with the Character on Dynamic Gravity UE4

I’m trying to create a world which is not a flat plane on the X and Y axis, and so it will have dynamic gravity. I have been capable of rotating the Character around a Sphere (for testing) by creating ...
1 vote
0 answers
64 views

Unreal Engine 4 How to read saved player data?

I seem to have writing working fine now. But I am running into odd problems reading the data back. I want to iterate over the files so I tried this but I got an error in the log stating something ...
0 votes
1 answer
48 views

Anyone about me how we make games in Android , also about me can we use c# or c++ in blender [closed]

game development in blender with c# hello everyone about me c# coding for games in blender game engine how i can use blender in Android because i'm new student in game developement Also about me how ...
0 votes
1 answer
99 views

How can I create an instance of an object on mouse click where the cursor is in SFML?

I'm new to coding. I'm trying to make a simple game where you can left click to spawn a salt "molecule" and right click to spawn a water one where the mouse cursor is. I don't know how to ...
0 votes
0 answers
57 views

How do I get Win32 GUI to render while rendering with DirectX?

I am trying to make a Map Editor for my RTS game in DirectX 8. Everything worked properly until I started drawing with DirectX, and now, everything is drawn after the main scene, preventing the ...
1 vote
1 answer
218 views

Casting from APawn* to MyCustomCharacter* ? Is this ok?

So I am still learning C++ but been using it for quite a while. But I have a function which is not working properly (separate question posted here: Calling Client RPC in order to assign a Team value ...

1
2
3 4 5
83