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.

0
votes
0answers
42 views

data is losing with sdl_net and tcp. please help me

im sending data from server.exe like this ...
0
votes
1answer
85 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
204 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
42 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
387 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
106 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
vote
1answer
121 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
589 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
70 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
71 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
205 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
36 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
32 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
336 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
66 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
317 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
43 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
170 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
1k 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
136 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
47 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
1k 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
67 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
42 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
226 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
49 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
223 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
207 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 ...
3
votes
1answer
134 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
352 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
142 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
314 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 ...
1
vote
2answers
148 views

c++ static only classes for subsytems and Engine

From the book Game Engine Architecture In C++, global and static objects are constructed before the program’s entry point (main(), or WinMain() under Windows) is called. However, these ...
1
vote
1answer
227 views

How to implement circle clipping in SDL2?

In SDL2 there's a function to set a rectangular clip mask: int SDL_RenderSetClipRect(SDL_Renderer* Renderer, SDL_Rect* clip); If i call this function, copied ...
1
vote
1answer
230 views

Can all DirectX11 games be deployed to Xbox One?

If I program a game with DirectX 11 and C++ and make my own implementation can I deploy it on an Xbox one to test it? Otherwise, what do I need to do so?
0
votes
1answer
121 views

Specular light for DirectX11

I illumine model through model illumine of Phong. Ambient and diffuse light’s constituent work well, but specular works wrong. Under this message I sent screenshoots: 1) ambient and diffuse 2) ...
0
votes
1answer
92 views

Normals transformation problem

I am working on my first Direct3D game and even after many days of searching Internet and experimenting I can't figure out how to work with normals properly. As a result, the lights are not working ...
-3
votes
2answers
319 views

Random points spread like old TV static in a polygon OpenGL

OpenGL version 3.1 Have to draw around 10000 randomly placed and colored points inside a rectangle to appear like old TV static but colored as shown in the image below. Right now the code draws a ...
1
vote
0answers
125 views

What's wrong with my normal mapping, and how can I fix it?

I'm trying to implement Normal Mapping in Directx and I'm very close to creating it but I'm getting these weird black colors on some objects. This is how it looks like without the Normal Mapping: And ...
0
votes
0answers
67 views

How can I load a script once in LuaJit/Lua and use it across multiple VMs in different threads?

So, I came across an interesting problem. I'm implementing some threaded game logic, and one of the things I decided to do was to use Multiple Lua VMs, with each worker thread containing its own VM. ...
1
vote
0answers
47 views

binding glm operators with luabridge

I am attempting to expose glm vector functions/data to luabridge like so: ...
0
votes
0answers
38 views

SFML Include Issues

I'm trying to copy over a VS2017 solution/project which uses SFML to a different machine. On the original machine, everything compiles and runs fine however when copied over to the second machine (...
1
vote
1answer
761 views

How To Resize Existing Texture In OpenGL 4.3

I would like to know how to resize an existing OpenGL 4.3 texture while keeping the current contents. i'm using glTexImage2D(). Do I simply re-call ...
0
votes
1answer
166 views

How to sort poker hands? c++

The examples below come from the answer by Steven Stadnicki in Determining Poker Hands Suppose a player get a hand like A9772. I would like to store the hand as either 77A92 or, better yet, 7A927. A ...
0
votes
3answers
191 views

Planning Class Inheritance for Game Objects

This is specifically about the development and planning direction of the game development. I'm creating a fairly basic RPG and am wondering about the approach that I should take. I've been trying to ...
4
votes
0answers
129 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
1
vote
2answers
151 views

Tetris - Smooth piece drop (c++)

So I have coded simple tetris games on the past but I have never done one where the pieces drop smoothly, like for instance Super Tetris 3 on the SNES.I am planning to learn SDL and for such I want to ...