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

How to implement jumping on the left and right?

I am trying to make a platform game in C++ and SDL2. I tried to add a jump in the update() function of the main code below , but it does not work as expected, as you can see in the video: Note: I did ...
0
votes
0answers
26 views

C++ && SFML game class [duplicate]

Im making c++ && sfml game for my teacher. I need to make game class naturaly I make constructor and destructor, but I cant figure out what methods should game class contain. curently it has ...
1
vote
0answers
110 views

Unreal Engine 4.25.4 - CreateDefaultSubobject inside a child component attached to an actor loses values in blueprint editor

I have the following actor: ...
0
votes
0answers
17 views

reflecting objects by rendering them to the cubemap

I have 2 sphere objects and it isn't reflecting the other one. The picture is when it simply reflects the cube map but when I try to render to the cube map the spheres turn out black. In camera class: ...
0
votes
1answer
103 views

How to update the data in the source code to avoid cheats?

I developed a multiplayer fps game in C++ and many peoples appreciated it, and today someone has created cheats for my game and he is trying to spoil my hard work which I spend developing the game. I ...
0
votes
0answers
33 views

How to implement layer based collision in C++?

I need layer based collision for my game, the problem is I don't really have an idea how to implement it. I'm using C++ and a graphics library called SFML. The only idea I got would be an array of ...
1
vote
1answer
41 views

How to disable present function when window is invisible to user. Win32 & DXGI

When my game window is hidden say by minimising it or hitting Ctrl, Alt, Del. I get the DXGI error: 0x087A0001 : The Present operation was invisible to the user. I've tried wrapping the present ...
0
votes
1answer
51 views

C++ SDL2: How to join two windows in one: top_Window + bottom_Window?

I have a code where the camera scroll left, right, up, down, and I would like to add a progress bar similar to the one below at the bottom of my window Is it possible to create the progress bar in a ...
2
votes
1answer
132 views

What's causing this stutter when framerate fluctuates?

I'm working on a class responsible for arm sway in an fps engine, and am having an issue with a stutter that appears to be related to fluctuating framerate. However I have also noticed it when locking ...
0
votes
0answers
76 views

is there any different solution for different buildings different behaviours

I'm trying to make different behaviours for workers of different buildings, let's say an agricultural worker would need to sow wheat seed and collect the wheat grain when it's grown. let's call that <...
0
votes
0answers
82 views

SDL_Init segfault on linux

I am using Manjaro linux and SDL 2. However, when I build the application in debug mode and use gdb or something like qtcreator with gdb, to debug it, it gives me a segfault, when the function ...
0
votes
1answer
65 views

JoyStick::GetInfo(JoyStick::id1).dwButtonNumber always returns 0x1

I am using an XBox 360 gamepad for Windows. I am having an issue with the following legacy code base, which relies on JOYINFOEX, ...
0
votes
0answers
52 views

Frustum culling issue at oblique angles

I am using the following algorithm to test if my camera frustum contains an axis-aligned bounding box: ...
0
votes
0answers
27 views

Unreal4, C++: Spawned actors visible after stopping, not during play

I've created a class with a function InitializeModel, that is exposed to blueprint. In this function some AStaticMeshActors should be spawned, but I cannot see them during play, I need to stop the ...
-1
votes
1answer
99 views

What is the best way to approach a multi pass rendering system?

I am trying to code a new feature in my engine but I can't find a way to implement my idea, which is the next one. I am trying to get multi pass rendering with more than two passes. I know how to do a ...
0
votes
1answer
86 views

OpenGL/C++ Rotate relative to shooting gun

I'm trying to make a 2D game where I have a gun that i use to shot things in the direction of the mouse resulting in an angle that I can get. I have some problems with the trajectory of the bullet ...
1
vote
1answer
130 views

How to allow infinite custom inputs?

Summary: What approach should I take to allow custom inputs saved in a file be interpreted in the engine? So I am making a game engine similar to Mugen where I want characters to have their own ...
2
votes
2answers
96 views

Getting data from the backbuffer D3D11 using Map [duplicate]

I'm having some trouble using ID3D11DeviceContext::Map() correctly. Here's the whole function so far: ...
0
votes
1answer
87 views

How do I get my sprite to do a regular jump instead of jolt up?

I have been getting into game development and I have made some progress. I have come across an obstacle which is jumping I managed to get the Jumping to semi work but it doesn't look like a jump but ...
0
votes
0answers
49 views

How to efficiently average multiple rotations (quaternions)?

So, I'm working on an animation system in C++, and am trying to blend multiple animations together. A slerp is easy on two quaternions, but is it efficient (or accurate) to chain together for more ...
1
vote
0answers
69 views

OpenGL model not rendering properly

I have been playing with OpenGL for a while and I came into the wall that I don't know how to pass. I am trying to render a model of an object based on a .obj file. In that file I have position ...
0
votes
1answer
85 views

Attempt to fix sprite sheet pixel bleeding in OpenGL 2D causing sprite distortion

While working on a project, I encountered the common problem of pixel bleeding when trying to draw subregions of my sprite sheet. This caused sort of "seams" to appear at the edges of my ...
1
vote
0answers
34 views

SDL Texture not scaling to the renderQuad

I'm building a Space Invaders clone and using a sprite sheet for my invaders, but when I grab the texture from the sprite sheet, it doesn't scale to the renderQuad that I set. This is the original ...
0
votes
1answer
42 views

How to Sync the Location After Getting Up from Ragdoll?

I am currently working on multiplayer fighting game and my game will have an anim->ragdoll when the player is knocked out and be able to getting up from it. My problem now is ragdoll is making my ...
0
votes
0answers
45 views

Z-Buffer Problem

I was working on my engine and while implementing post processing a very weird bug appeared. It seems to come from the Z-Test but I can't firgure out what exactly it is hapening First of all here's ...
1
vote
1answer
120 views

Instantiating GameObjects in Custom Game Engine

So,i'm having a bit of an issue with instantiating my gameobjects into to universe(My Scene object). I can create an empty object from scratch and populate it from there with ease,my problem starts ...
0
votes
2answers
117 views

Smooth out movement of the snake in a 2d Snake game

I am working on a 2-D snake game in C++ with the SFML library. I would like to smooth out the movement of my snake as it looks extremely choppy currently. How the Snake moves The snake is made up of a ...
1
vote
1answer
153 views

Unable to create Shader Object for Geometry Shader (GL_GEOMETRY_SHADER)

I am just starting with OpenGL using c++ on Ubuntu 18.04. The problem I have is that when I try to link Geometry Shader in my main program, the following function call is unable to create an object (...
0
votes
1answer
146 views

Half of my tris are textured in streaks and blurs

I have written code to import meshes from OBJs and textures from BMPs. My texture coordinates seem to be getting messed up somehow, or some other issue is occuring, because I am getting these effects ...
0
votes
0answers
43 views

Click event won't trigger?

When the screens shows, there is one squere when ckicking on the square, it should create 4 squares. First i made the explosion. This is made in the drawExplosion but when i try to change the enum ...
0
votes
0answers
113 views

How can I do real-time mesh deformation?

I have a very simple problem: I have a icosphere mesh rendered with OpenGL and I want to deform/stretch it. But it has to be a real-time process because the deformation is generated when user drag'n ...
0
votes
0answers
46 views

Calculate whether you can jump from one platform to another

I need some kind of formula that will help me connect two platforms that are reachable to each other by jump. I am working on a pathfinding implementation for a 2D platformer and preprocessing the map ...
0
votes
0answers
56 views

How to draw a screen space decal along a desired projection direction and control which surfaces it affects?

I am currently programming a complex 2D lighting system which calculates lighting in 3D space. Something like what I want to achieve (Source @pixpilgames from Twitter): I recently learned how to ...
1
vote
2answers
185 views

OpenGL only rendering 4 tris of cube?

I'm on Win10, OpenGL 4.5 I wrote some code that takes mesh data from an OBJ file and puts it into a vertex buffer. I used this code to import a cube OBJ and render it in OpenGL. For some reason, ...
0
votes
1answer
164 views

UE4 C++ - Add generated source code folders to Visual Studio solution?

In Unreal Engine 4, using a Visual Studio solution and projects generated from the Editor using the First Person Template, the layout of the Solution looks something like the following: I am not a ...
1
vote
1answer
22 views

Bind render result to texture id

I want to save the result screen of the rendering and then apply another shader on that result, the typical way is to read the screen using glReadPixels and then buffer that image to gpu and then ...
0
votes
0answers
45 views

GLFW Problem “The driver does not appear to support OpenGL”

I am trying to learn OpenGL & GLFW , when I run this simple project I get error ID : "65542" with the message "The driver does not appear to support OpenGL". My graphics card ...
3
votes
0answers
39 views

Access GLFW functions from DLL

My game uses DLLs as mods. Players can write DLLs which can render, play audio, print to console, etc. This works fine, however when I try to access GLFW functions, they don't seem to work properly. <...
0
votes
0answers
104 views

How to copy morphs from one SkeletalMesh to another in UE4?

I would like to enable modders to copy morphs from one SkeletalMesh to another. I wrote simple Python script to do that. The inspiration came from here. ...
0
votes
0answers
29 views

OpenGL obj loader fails to work

...
0
votes
1answer
61 views

C++ map isn't finding key even though it exists [closed]

I am in the process of learning C++ for the Unreal engine. I am trying to figure out why when I use the [] operator on a map<Vector2, ControlNode> with a value that I know is in the map, it ...
0
votes
0answers
87 views

C++ Help with Separating Axis Theorem

I am trying to detect collision between two triangles using Separating Axis Theorem however I am unaware what is wrong with my code. The CollisionHelper::isTriangleIntersectingTriangle is called every ...
0
votes
0answers
192 views

'CoreMinimal.h' file not found when building on Unreal Engine on Mac

I'm trying out C++ on Unreal Engine 4.25 on Mac. If relevant, my Xcode version is 12. When I try to compile, there's an error: 'CoreMinimal.h' file not found. I've ...
0
votes
0answers
53 views

Box2d on authoritative server for Unity client

I'm creating a multiplayer platform and shooting game in unity, using unity2d's own physics system (box2d). But the truth is that I am quite lost in the creation of an authoritative server in c ++. I ...
0
votes
0answers
32 views

Same image in both eyes of VR HMD results in wrong 3D effect

I am trying to mod in VR support for a game without VR support via OpenVR as it proved to be the easiest one to implement with the least amount of issues, i don't think my issue is related to OpenVR ...
0
votes
1answer
49 views

Online multiplayer. Provoke lagged move on local player

I am developing an online multiplayer 2D videogame with Unity as a client and a server programmed in c ++. I do the synchronization of movement through an interpolation so that the movement is ...
4
votes
1answer
196 views

space map generation

I am at the beginning of the creation of a space 4x and first of all i need to generate a galaxy of stars linked by connecting lines that changes in each new game, I'll add a few pictures to show what ...
0
votes
0answers
24 views

NDK opengl-es unknown error

Projection matrix? Renderer? Where is the error? I recently started studying NDK to create better performing android games ... but ... An error I didn't expect to deal with appeared a few weeks ago ...
0
votes
0answers
63 views

Optimizing Box2D for a couple hundred static bodies

I searched but could not find anything similar (Yet) around the web, so here I am asking my question: In my game I use around 3 to 4 hundred static bodies with like 10 dynamic bodies in the Box2D ...

1 2
3
4 5
81