Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

2
votes
3answers
344 views

Implementing reference counting from scratch or using shared_ptr for resource?

In an OpenGL application that I am writing, I want to have a simple shader class to wrap the OpenGL shader handle. Ultimately, I want this shader class to behave very similarly to a shared_ptr in c++ (...
0
votes
0answers
136 views

If Statement always runs irrelevant of the condition in it in C++. Why?

I’ve been using C++ with the SFML library for a while. And I have encountered this problem which I am not sure how to fix. I am working on a game and below is a part of its code that is not working ...
0
votes
1answer
386 views

Is there a plugin example for SKSE Special Edition?

I'm having trouble creating a skse plugin for skyrim special edition. For the old version there is a example plugin: https://github.com/xanderdunn/skaar/releases/tag/plugin3 I've tried to do it by ...
3
votes
1answer
221 views

Is there a “Least Terrible Method” for sharing Entities over Network?

(Preface: Using C++, Box2D, and built UDP client and server classes that are reasonable efficient for a built-from-scratch game using client-server model.) This question is specifically in regards to ...
0
votes
0answers
27 views

Bitblitting with transparency

I'm writing my software renderer, and I'm trying to optimize bit blitting. So I did write the blitter, but have hard understanding of how to do transparency. I know the usual way is to check if the ...
1
vote
0answers
149 views

Plotting 2D map coordinates to OpenGL 3D projection

I’m trying to convert a 2D map created in my map editor to a 3D plotting with OpenGL. This is my map generated in my map editor: Those vertices are relative to my Cartesian origin world coordinate (...
0
votes
2answers
307 views

OpenGL Array Texture generates black texture

I am creating a game using OpenGL that has many textured cubes. I am trying to use an Array Texture to load multiple textures from one file. I tried to setup my texture atlas; however, all that ...
1
vote
1answer
148 views

Separate game engine from game

I'm building a simple game engine (or mostly rendering engine) and I would like to separate the "engine" part from the "game" part. So, I've come up with an idea to build "engine" part as a library (...
0
votes
0answers
153 views

c++ separation steering algorithm showing weird results

I'm implementing a simple separation steering algorithm (for axis aligned 2D rectangles). The algorithm: For each rectangle (cell), check all others for overlap if overlaps, calculate difference in ...
0
votes
0answers
55 views

Cocos2dx Follow action is not working

I am making a 2D platformer game and I want my camera to move with the player sprite. There's a Follow action in cocos2dx which I used but Its not moving the scene as expected. Please take a look at ...
0
votes
1answer
52 views

CompileFromFile syntax error upon compilation

I am using visual studio c++ 2003 edition and I am trying to use the function CompileFromFIle function from DirectX SDK February 2010 SDK to add bloom to my source code for a mod I am working on and I ...
0
votes
1answer
94 views

OpenGL is not drawing model with more than one material

I have model created in Blender that have 3 UV Maps, 3 materials and each material has texture. Below you can see it. Also I have OpenGL application that draw this model. Application is working ...
1
vote
1answer
65 views

Nvidia High Performance Processor Setting leads to graphical bug (Seizure Warning) with current lighting system, drawing completely in the shader code

I followed the Lighting tutorial on learnopenGL, modifying some of the code to work in a 2D game engine. Everything was looking great and my team got our game done and the lights were quite simple for ...
0
votes
0answers
40 views

data is losing with sdl_net and tcp. please help me

im sending data from server.exe like this ...
0
votes
1answer
76 views

Bullet Physics too many rigid bodies framerate drops

I have a question regarding rigid bodies in bullet physics. At the moment I have low-poly asteroids, which I create a convex Hull shape. Then I add a motion state and give them a linear velocity. ...
1
vote
1answer
178 views

Getting multiple inputs in C++ simultaneously using kbhit() function

I am using Turbo C++ to make a game using the graphics.h library (I know it's a bit old). In this game, the player can move left, right and they can jump using A, D ...
1
vote
1answer
41 views

Why do I only receive the first message I send with SDLNet?

I am sending two messages from server.exe like this: ...
4
votes
3answers
350 views

Class for each specific item in an RPG, or use a factory?

I had a question regarding the best way to have items in my RPG game. Currently I have a class structure in which everything inherits from GameObject. Item inherits GameObject. Armour Inherits Item. ...
0
votes
1answer
101 views

What does distance divided by acceleration mean?

I'm reading a book named "Programming Game AI by Example". Here's a method to help an autonomous character to slow down when it's getting closer and closer to its target: ...
-1
votes
0answers
28 views

d3d12 how to run an external program inside of an window

Hey I need to know how to run a process ".exe" inside my d3d12 application window So for example the inside border of my window needs to be able to run a program like a game inside of the parent ...
1
vote
1answer
106 views

C++ Text RPG - Commands and their output

Synopsis So far i tried to make games and most of the times i finished on having 'engines' ready. Not the games at all. I figured out that after having rendering, music, i/o handling, all that stuff ...
0
votes
1answer
399 views

IDE cannot find CoreMinimal.h, Unreal Engine 4 course

I'm following this tutorial on Udemy about learning the basics of Unreal Engine as I start up my CS degree, and I've reached a problem where CoreMinimal.h cannot be ...
0
votes
1answer
56 views

Opengl Postprocessing draws only white

I'm currently trying to implement post processing into my project. First I configure my framebuffer: ...
0
votes
0answers
59 views

Steam Controller Interface in Unreal 4.19?

As I understand it, you're supposed to use Unreal's Online Subsystem when doing anything with the Steam SDK. However, when I look into the available interfaces (Engine/Plugins/Online/OnlineSubsystem/...
-2
votes
1answer
173 views

How to use discord-rpc with GMS 2?

I want to add Discord Rich Presence to my game using discord-rpc but I don't know how to do this?
0
votes
0answers
34 views

Projective texturing in DirectX11

I'm trying to implement reflections on flat surfaces and render a simple scene with a reflection. So I'm rendering the scene from the point of view of a camera symmetrical to the reflection plane and ...
0
votes
1answer
29 views

Can I used a NES USB controller with XInput?

I'm doing a project to graduate from my game design degree and I have to recreate two levels from MegaMan(1987). I saw that there are usb nes controllers out there that are used for emulators on PC. ...
0
votes
0answers
261 views

Why is Assimp mOffsetMatrix different from inverse bind pose

I am doing skeletal animation and my model gets distorted. I suspect it was because of the inverse bind pose, which I calculate by concatenating all the mTransformation starting from scene->rootNode ...
-4
votes
1answer
64 views

is if statements important or do I need them [closed]

Hey I was wandering I am needing some advice I am using #if expressions to execute my code and I was wandering if you have #if expressions is it really needing to use if statements in your c++ source ...
2
votes
2answers
259 views

Using polymorphism in an Entity-Component System without sacrificing data-oriented design

I've been planning out an Entity-Component System in C++. My idea of it is most in line with the one described on this page of the entity systems wiki. To summarize, components are just structs of ...
0
votes
1answer
38 views

Custom Model Format & Loading

I've been working on a small engine for educational purposes. I understand that going production with "raw" model files like .obj is wrong mostly because of parsing and loading time. Thus, I want to ...
0
votes
0answers
69 views

Creating state machines to handle multiple aspects of a game?

So first off, I'm not sure if it matters but I am using SFML and C++. I've been wanting to write a game and I've read a lot on FSMs and what they do/make things easier for managing games, etc. What I ...
1
vote
1answer
131 views

Why am I getting the error “SDL_Event has not been declared”?

I don't understand what I'm doing wrong. In my game.cpp, I have this: ...
0
votes
1answer
919 views

Why am I getting these errors when including stb_image.h?

I'm trying to put an include guard around including stb_image.h (from the well-known public domain image library). I have noticed that, unusually, the include ...
1
vote
1answer
101 views

Unintended stuttering when moving camera

I am using opengl and GLFW to make a rendering engine. Things work per se, but there is some weird flickering happening when I move the camera. Due the nature of the problem I need to link a ...
0
votes
1answer
46 views

Errors while instancing particles

Im creating a particle system of my own, and I have some draw issues with it. It's the first time I use instancing, so it's probable I have some concept errors. First, I create three buffers: one for ...
1
vote
1answer
734 views

UENUM definition in header file

I am trying to define a simple enumeration in a header file as per the example published here. My header file consists of the following: ...
0
votes
0answers
63 views

How to integrate eye tracking with Unreal

I have eye tracking hardware and software (not a Tobii) and would like to integrate it to Unreal. Previously I have no experience with Unreal at all. Generally what I would like to achieve is to ...
1
vote
1answer
41 views

how to move a char value “down” in a two dimensional array?

I managed to move it up, left and right but when i try to move it down it goes to the last Y position in the array instead of the Y position below it. the code i wrote to move it up, left and to the ...
0
votes
1answer
160 views

SFML Keyboard Input

I've implemented a basic Keyboard Input manager: ...
1
vote
0answers
143 views

Uniform arrays do not work on every GPU

I am trying to implement instanced rendering for objects that repeat, so I came up with idea I could simply group objects that loaded same model files, create array with their Model matrices and so on,...
0
votes
2answers
47 views

How to keep an object in a certain part of the camera view?

I have a 3d camera that is viewing a character that is moving. As the character is moving i want the camera to adjust itself so as to keep the character in the left third of the camera view. I ...
0
votes
0answers
172 views

Do I need to remove a weak pointer from an unreal multi-cast delegate/event?

I'm declaring an UE4 event in UObjectA DECLARE_EVENT( TypeWhichBroadcasts, MyEvent ) MyEvent myEvent; and bind function(s) in ...
1
vote
1answer
171 views

Simple mouseray picking in openGL

Ive been looking at tutorials and trying to figure out how to do basic ray-picking. But I'm stuck at figuring out what space to do the distance calculations in. What space does ...
0
votes
0answers
45 views

FreeGLUT - Making Planets Orbit at their own Speed

I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link ...
3
votes
1answer
128 views

How can I simplify my state machine transitions?

I currently have the following base class which I inherit from for my player states (e.g. Idle, Walking, Jumping). ...
1
vote
0answers
303 views

SFML - How to implement a simple 2D lighting system

Lately, I've been reading a lot about 2D lighting systems in a game, and have observed just how much lighting can add to a game's graphics appeal. However, as for implementing one of these in SFML, I ...
1
vote
1answer
100 views

Camera movement issue with pitch and yaw angles

I'm trying to implement a simple first person camera using pitch and yaw angles (no quaternions, I want a simple camera for debugging purposes). An Input class processes mouse input and translate the ...
0
votes
2answers
131 views

Optimize polygons renderization

I'm developing a game (in Ogre3D) that, in short, consist in a vehicle that moves along a terrain and leaves a colored trail behind it. The trails are basically quads (a), these quads changes their ...
5
votes
1answer
289 views

How can I dynamically switch between graphics APIs?

In games like the new "Doom", you have a console, from which you can use commands to reduce the game's quality or even to switch graphics API, from Opengl to Vulkan and viceversa. How is this done? I ...