Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
1answer
50 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
84 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
25 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
12 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 ...
0
votes
1answer
26 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
60 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: ...
0
votes
0answers
53 views

Can someone tell me how games are making with c++? [closed]

Can someone who has a lot of knowledge in game developing with c++ tell me how games are developing? How object are making to move? And write why you give dislike because I am new in this and when I ...
0
votes
0answers
21 views

Setting up OpenGL and GLFW with CLion [closed]

I can't find anything for how to get OpenGL and GLFW to work with CLion that works or that I understand. Can someone just point me in the direction or link a tutorial for how I would do this? Will ...
1
vote
2answers
75 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
71 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
84 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
0answers
52 views

Why isn't this data being passed on?

I've made an Input class with a method which returns a boolean array of a total of 1024 keys. This array is then passed on as an argument of the Update() function of every GameObject-inherited class ...
0
votes
2answers
61 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
48 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
56 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
97 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
199 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
161 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
118 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
25 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
44 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
42 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
151 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
33 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
35 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. ...
0
votes
0answers
45 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
58 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
33 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
28 views

Inverted left & right stick axes in SDL2

I've faced a weird problem with SDL2. ...
0
votes
1answer
70 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
94 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
114 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
39 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
84 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 ...
-3
votes
1answer
60 views

How can I quickly add bloom to my game engine?

The title says it all: I need a quick method for adding bloom to my game engine. No need for code, I only need the explanation.
0
votes
1answer
68 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
78 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
62 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
45 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
278 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
42 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
100 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
36 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/...
1
vote
3answers
82 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
116 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
62 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
199 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
25 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
72 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
56 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 ...