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

Correct way of combining A* and funnel

I implemented a pathfinding algorithm like this: There is a mesh of triangles that defines the area the player can walk. An A* algorithm is used for finding a path from the start triangle to the end ...
1
vote
1answer
113 views

Text Adventure - Engine actions based on dialogues

Building forward my text adventure i stumbled upon how to actually drive the actions that can be caused by dialogs. I wrote the dialogues and the logic around handling them already, but i'm missing a ...
1
vote
1answer
266 views

How can I avoid jittery motion in SDL2?

I am experiencing stutter when I am moving faster than 0.1 units in my program. When doing exactly 0.1 units I get: For test purposes I've made the bot always heading southeast. ...
0
votes
1answer
182 views

SFML 2.5 on Ubuntu 18.04 - cannot open shared object file: No such file or directory

I'm trying to run an example code with SFML 2.5 on Ubuntu, but without success. I'm using: VSCode 1.27.0 with the Easy C++ Projects extension on Ubuntu 18.04. The build/run output keep saying that ...
0
votes
0answers
37 views

Ray Sphere Interesection Distances WRONG

The discriminant is not working. This code produces incorrect distances from ray to sphere, but it can tell whether or not the ray does strike the sphere. HOW HARD IS THIS I'VE BEEN TRYING TO DO THIS ...
0
votes
1answer
69 views

The SFML equivalent of polling to see if a key has been released?

I'm testing out SFML by trying to make a square move with lerp velocity. The desired result was that when, let's say, D was pushed, the square would accelerate smoothly from ...
1
vote
0answers
53 views

Design of (texture) resource system

For an open source game I wanted to redesign the resource management system but got into a dead end and need some pointers to some reading material or where to go now. Starting point was (mostly) a <...
0
votes
1answer
57 views

SFML: How to draw/render from Screen class

Game architecture is as follows: // main.cpp ...
0
votes
0answers
139 views

How should a game server receive/send udp packets with a defined tick rate?

I currently have a game server with a customizable tick rate, but for this example let's suggest that the server is only going to tick once per second or 1hz. I'm wondering what's the best way to ...
4
votes
1answer
203 views

How to create a skybox in an infinite world like minecraft?

I'm making a minecraft-clone game in C++ using OpenGL. I created a skybox using OpenGL's cube map but the camera can go outside of the skybox since it's an infinite world. Then I changed it to update ...
0
votes
1answer
328 views

Access violation executing location 0x00000000

When I try to debug my program, this Exception is being thrown in a call to glGenBuffers. I'm using OpenGL and SDL. Here is my code: It consists of two classes: m ...
1
vote
1answer
123 views

Separating game logic and rendering logic in separate static libraries

I'm trying to write a game in C++ using OpenGL. I've tried to separate my game logic and my rendering logic as much as possible, and up until now, this has worked for me. I haven't written a lot of ...
0
votes
1answer
198 views

How to Design a Generic Collision Detection System?

I'm designing a C++ 2D collision module, and I ran into a problem designing a system where the collider is unaware of the shape it's colliding against. I'd like to have a abstract base class called ...
0
votes
1answer
74 views

Circle to Circle Collision of moving Sprites

i needed help attaching circle1 Sprite to circle2 Sprite on collision onto the same point where they are getting collided, and both circles are moving with Action. Like this, Attaching means, when ...
1
vote
1answer
302 views

How do I check if a window has focus in SDL2?

Is there a replacement for SDL_GetAppState function in SDL2 from older SDL versions? Why was it removed? I want to use it so I can check if the user has focused the ...
1
vote
1answer
391 views

Welzl Algorithm to find the Smallest Bounding Sphere

I'm implementing Welzl's Algorithm to find the Smallest Bounding Sphere. In brief, the algorithm works by maintaining: a set of points to contain in the sphere (inside its interior, or on its ...
1
vote
3answers
86 views

Rotation of a matrix with unequal rows and columns

I have this simple matrix class which has a char** array for storing the data. The data array gets initialized like this: ...
2
votes
2answers
226 views

Moving a camera without rolling (tumble not arcball rotation)

I'm trying to move my camera around using mouse+keyboard. I'm looking for specific camera behaviour however, and I cant figure out how to get it right. What I've found, is that to get a maya/tumble ...
0
votes
1answer
451 views

Native C++ console screen buffer

I'm trying to display a game in the console window using a screen buffer but cannot compile it. I have this simple code: ...
2
votes
2answers
279 views

How to draw a 3D capsule?

I want to draw a 3D capsule defined by a segment (two points start->end) and a radius: Image source: Orionist on Wikimedia Commons I already have a sphere leaning on this answer: https://...
0
votes
2answers
337 views

Correctly transforming normals for G-Buffer in Deferred Rendering

I have a deferred rendering system: first there is the G buffer generation, then there is the lighting or shading calculation on that gbuffer data. However there seems to be an issue with various ...
1
vote
1answer
89 views

Physics - How to calculate the next position of a ball rolling against a slope?

For a small C/C++ game project, I want to add some physics on a ball, to allow it to roll against the slopes of a 3d world, in the same way as the example visible in the image below: However I have ...
2
votes
1answer
78 views

Decouple GUI from Logic

I don't have an educational background in the programming-world; however, I've been working on a programm in my spare time for the last two years. I'm currently struggling with how to decouple the ...
0
votes
1answer
1k views

Base class undefined?

I have no idea why I'm getting this error except that it has to do with the includes. Base class header file: ...
4
votes
3answers
476 views

How can I tile Perlin noise to more accurately represent a world map?

I'm currently working on my game. I would like to generate the world map with Perlin noise, and wrap it just like a real world map. I've found a algorithm to create a map wrapped along X and Y axis: ...
0
votes
2answers
314 views

How to implement ECS in a videogame with C++?

What do I need to know in order to implement ECS in a video game? I'm developing a video game and so far I wasn't using any complete architecture, I was just using inheritance but I don't like it ...
2
votes
0answers
132 views

Getting false positives with SAT

I've been trying to get proper collision detection with SAT in 3D. I started of with this post: How many and which axes to use for 3D OBB collision with SAT. I've been trying to get the right axis to ...
0
votes
1answer
36 views

C++: Setup the basic Update function in different classes which all derive from GameObject

Im working on a little game-framework in c++. Currently i have a (base)class called "GameObject" from which all future in-game objects will derive from. Class enemy will be ...
0
votes
0answers
54 views

How do I find the texture origin using UV data?

I am writing a map decompiler for the video game Tron 2.0 and its map editor, DEdit. DEdit requires a set of three vectors in order to correctly map textures to each model. The vectors are what I ...
1
vote
0answers
63 views

How to implement weighted blended order independent transparency in OpenGL?

I want to implement weighted blended OIT in my C++ OpenGL 3D game, but I didn't find any C++ examples about weighted blended order independent transparency. Paper How to clear accumTexture(...
0
votes
2answers
223 views

How can Perlin Noise be modified to not tile?

In vanilla perlin noise, the texture repeats after 256 coordinates, due to the way it picks a gradient vector. In games that require an infinite procedural world, however, this is not an acceptable ...
0
votes
0answers
39 views

Pseudo 3d roguelike: map representation [duplicate]

I know it's a very common question, so I'll try to be specific. I'm working on a pseudo 3d (like Dwarf Fortress or Cataclysm: Dark Days Ahead) roguelike. How you'd represent a map in a roguelike? Let'...
0
votes
0answers
40 views

Finding a tile data in an array

I have tile vertices stored in an array. How would I go about finding a tile when given its position. ...
-1
votes
0answers
48 views

Manage Object Variables

I'm working on a small game project on C++ and DirectX 9, I have some difficulty in manage all object, so I'd like to hear from those have more experience in game programming Here's the thing. I ...
0
votes
1answer
290 views

What's the difference between UClass and UObject?

I know that UCLASS() macro creates a seperate UClass for every UObject class ,but what is the need for this seperate class , how both of these classes relate to each other and what is the basic ...
0
votes
0answers
41 views

how can i start mipmap technic from character?

hi how can i start mipmap technic from character ? i mean example like this picture : in my code mipmap starts from camera(Near Clipping Plane). i dont want this. ...
0
votes
0answers
61 views

Inverted left & right stick axes in SDL2

I've faced a weird problem with SDL2. ...
0
votes
1answer
170 views

C++ - How to create an engine editor without frameworks like qt and wxWidgets?

Basically sometimes I like to try to venture into the world of graphics computing, sometimes I have a project or another that uses opengl plus all the "blind" with opengl, I wanted to be able to ...
1
vote
1answer
565 views

Why am I getting an access violation when assigning to a 2D array member?

c++ Beginner here, coming from Java background, and I'm getting the feeling this is a c++ specific error I'm running into. I am trying to procedurally generate a 2D map, which is of type Tile[y][x]. ...
2
votes
2answers
131 views

Time based events separate from the game loop

How can set up time elapsed based events separate from the game loop? I want the character to heal over real time rather than per cycle of the game loop. How might i do that?
0
votes
1answer
53 views

VBO interleaving dillema

I'm trying to write a map editor for a unity game using openGL. In order to do that, I need to unpack it's resource files to get meshes, textures and other good stuff. In doing so, I've discovered ...
1
vote
2answers
103 views

c++ text rpg loading rooms/mobs

So for practice and as a learning exercise i foolishly decided to make a text based rpg on my phone using the c4droid ide. ive done well and have learned a lot. So far you can create a new character ...
0
votes
1answer
85 views

Intel GPU running faster than Nvidia GTX 1060

My app in its current state renders only 2 triangles to the screen using OpenGL. I am using std::chrono::steady_clock for frame counting. With Intel graphics, I ...
1
vote
1answer
111 views

Why is my call to SetDisplayMode not supported?

I have some legacy DirectX code that always returns DDERR_UNSUPPORTED. I originally developed the code using DirectX3, and I am porting it to DirectX7 after ...
0
votes
2answers
232 views

SDL/C++ Keyboard Input

I'm having trouble with key management. Movement works fine but the shooting does stuff that I don't want to happen. Every time I press the arrow keys to shoot it works fine but when I press a key ...
0
votes
1answer
88 views

Unreal Engine: Access Violation on FObjectFinder

I got a problem with my project in unreal. I wrote some code about a month ago and it worked fine until yesterday when the editor started crashin on launch. I get this error message in the log: ...
1
vote
3answers
311 views

Why is OpenGL displaying this specific color as white?

I have a sprite class that is supposed to make a 2D rectangle based on the location, colour and size of the rectangle. I have created a renderer class that uses this sprite class to create buffers and ...
0
votes
1answer
138 views

Editor-Assignable function pointer in UE4 C++?

So I have a TriggerBox that I'm using as a pressure pad, and I want to be able to attach objects to it that, when the TriggerBox is activated, will have specific functions called. Similar to unity's ...
0
votes
1answer
397 views

C++ in Unity with dependencies

I am currently creating a c++ program to eventually use in Unity. This c++ program contains references to libraries like OpenCV and dlib, referenced with a include statement which calls in other files,...
0
votes
2answers
189 views

What does linearDamping mean in Box2D?

If I set linearDamping on a body, it's velocity will be decreased slowly, until it stops. The documentation says, that the units are 1/time, which is unclear for me. If the velocity of a body is 10 m/...