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.

-1
votes
0answers
74 views

OpenGL: Depth Stencil buffer won't write underlying texture attached

I'm currently developing an emulator and I got some games using GL_DEPTH24_STENCIL8 (D24S8) as depth buffer. The depth buffer works fine and all but the underlying texture does not seem to be written. ...
0
votes
1answer
33 views

mouseButton.y and mouseButton.x is -858993460 for every event except MouseButtonPressed

Using SFML, every event type will produce a large negative value for x and y of -858993460. ...
0
votes
0answers
47 views

Array-Backed Entity Component System with Component Polymorphism

I'm tinkering with an array-backed ECS in C++ along the lines of EnTT. Components are stored in a struct-of-array fashion where each component type lives in its own homogeneous contiguous memory block....
0
votes
0answers
39 views

Is there any best book or site(instead of docs) for unreal engine core system in c++ source code level? [on hold]

Is there any best book or site (instead of docs ,wiki..) for unreal engine core system in c++ source code level? I want something like overall unreal engine code architecture (not for gameplay, just ...
0
votes
0answers
32 views

initialising constructor

I am using the SFML library to create a 2D grid. i use grid cords so I can place my players on the grid: I use struct to hold information of the nodes ...
0
votes
1answer
89 views

Game Engine Renderer Architecture

I'm currently building a game engine renderer but I got stuck when I had to separate engine and client code. I had been following OpenGL tutorials to learn about buffer creation, etc so all my code ...
0
votes
1answer
32 views

How to use This Keyword and using iterators to call class methods?

I've been over this for a long time, I can't seem to understand what is wrong, is the use of the this keyword right? I want to add the instance of the class that is being created to the vector '...
0
votes
0answers
20 views

SDL_WarpMouseGlobal does not work in game

I tried to use SDL to move mouse in game. The function works fine only in menu, when I join a game, the function does not work. I checked coordinates with ...
2
votes
1answer
51 views

SDL render surface from byte array efficiently

In my current project I need to fill a 256x224 screen with the pixel values from an array. The array is declared this way: uint8_t *vram = new uint8_t[7168]; So ...
0
votes
1answer
31 views

Direct3D & Assimp Texture is inverted weirdly!

I'm working on a rendering engine but even on the first mesh is something wrong. I use assimp for mesh importing! In the Assimp Viewer it looks correct: And in my software it looks like this: Look ...
0
votes
0answers
30 views

How to make the screen not flicker?

I want to be able to draw all my text, lines , triangles and other stuff to screen and then clear the screen and draw something new, BUT this method makes the screen flicker, and all the drawings dont ...
3
votes
0answers
61 views

Linking Unreal Engine with OpenCV libraries built with RTTI on Linux

Unreal Engine has a plugin for integrating with OpenCV. Currently that plugin works on Windows. I'm trying to modify this plugin to work on Linux. I've worked through many issues but I have one I can'...
0
votes
0answers
20 views

DirectX 11 - Input Assembler - Vertex Shader Linkage error - SpriteFont

I'm trying to render text in my DX11 project, by using SpriteFont and SpriteBatch. Everything worked before adding the code in,...
0
votes
0answers
29 views

Lua/LuaBridge with C++: No matching function for call to 'luabridge::FuncTraits::call'

I'm trying to implement cutscenes for my game using LuaBridge. Right now I'm setting up the Cutscene State, which creates a Lua state, stores it, and loads a script. I'm trying to set the functions up,...
0
votes
0answers
50 views

OpenGL mouse to world position

I'm trying to implement an editor like placing mod with opengl. When you click somewhere on the screen an object get placed in that position. So far this is my code ...
1
vote
1answer
68 views

How can I exit an Unreal game with a specific exit code?

How could I quit out of a Unreal game with a specific exit code? In Unity you can just Application.Quit(exitCode); but I could not find anything regarding Unreal. ...
3
votes
1answer
63 views

How to access internal data from separated rendering-layer?

I am currently rewriting a project I have been working on last year and I’m utterly stuck trying to "correctly" separate the game-logic from its representation. I know why this is beneficial and I ...
0
votes
0answers
66 views

Game Engine Class and Subsystem Architecture

I have a quick question for those who have experience coding their game engine and such. I was wondering what a better approach would be when designing my own game engine. Right now I plan on having ...
0
votes
0answers
54 views

what is the sequence in using the “send” and “read” commands on the game client and server? boost asio

I have a voxel game in which you can run on blocks (chunks), jump and set/delete blocks. I want to write an asynchronous TCP server for it and choose boost asio as the network library. I have two ...
0
votes
0answers
29 views

Center of World Map not the same as the center of my Bullet Physics World

As you could see in the image, the center of my map should be located at the intersection of the diagonal lines. When I import 3D buildings within the area into my Bullet physics world, I want to set ...
1
vote
1answer
48 views

Getting AABB Collision to work - C++

I've been trying for weeks to get AABB collision set up on my DX11 project. So far, I have a 'condition' set up in place, so that when both cubes collide the 'light' cube will show within the scene. ...
0
votes
0answers
25 views

Dual Quaternion - How to apply the dual quaternion as a transform (Without converting to a matrix)

I've been trying to implement dual quaternions for a bone system and I have a few questions about them. I started by reading the beginners guide to dual quaternions (link: http://wscg.zcu.cz/wscg2012/...
0
votes
1answer
76 views

Sprite Management

I'm working on a game right now using my own engine. In the engine, I have a State Machine which handles input for, updates, and draws the current State - the one at the back of the vector. The game ...
0
votes
0answers
41 views

How to organize data transfer between the client and the game server?

I have a game like minecraft, I can run, set and delete blocks. The world consists of a limited set of chunks. I want to write a server for it with the help of a library called boost asio. I need help ...
1
vote
1answer
616 views

Why can't this simple SDL app be closed without task manager or rapid clicking of x button?

I wrote a simple app that generates a window, a raster, and redraws the raster once every 16ms. Right now the calculations are empty, it just draws a solid color. I don't know how, but I have created ...
0
votes
0answers
14 views

combine two translation/rotation/scale triplets without matrices

Let t1/2, r1/2 and s1/2 be two sets of transformations. Translations are vec3, rotations are quaternions and scales are vec3. Lets assume that all common operations are defined (overloaded operators ...
1
vote
0answers
46 views

Multiple Viewports/Windows Dear IMGUI c++

How do I use IMGUI with multiple GLFW windows? I know Dear IMGUI already has a virtual viewport system going in the viewport branch but I found that to be lacking a bit on how to use this new system. ...
0
votes
1answer
49 views

Can't figure out why my mouse picking code doesn't work

I am trying to create code to check for intersections between bounding spheres and the mouse. I get a mouse ray but it doesnt seem to point in the direction you think it should Attached is a ...
2
votes
1answer
103 views

Overlaying Menus with a State Machine

I'm working on developing a game with C++, SDL, and OpenGL. I created the engine from scratch, and implemented my own state machine to handle menus and general gameplay. Each State gets pushed into a ...
1
vote
1answer
69 views

Frustum Culling bug in program

I did Frustum Culling in my engine, but it does not work correctly. All shown in the video: Video If the approximation is too close, the model disappears. On the right in the console you can see ...
0
votes
1answer
43 views

draw concave polygon from set of edge points

I'm having troubles trying to rearrange a set of points where each point is part of the edge of a concave polygone. My set of points is not sorted in any order, they are just randomly put in an array. ...
0
votes
1answer
42 views

Huge input delay although framerate is stable - possibly related to the DirectX Tool Kit?

I'm in the process of learning how to use the DirectX 11 API and came upon the following problem: Although my rendering function executes quite fast at around 150 fps (as one expects considering how ...
0
votes
1answer
33 views

2D Rotation of an object along a curve line

I would like to rotate an object along a curve. I managed to move the object along the curve using bezier curve algorithm. The hard part is to rotate the object constantly(no limit on maximum angle), ...
3
votes
1answer
43 views

Calculate angle between player and end point

I have such question: how to calculate angle between player and end point? Things, which i have: Player. I have X, Y, Z position of player and his Z-angle (0-360) Endpoint. I have only X, Y, Z ...
0
votes
0answers
19 views

(C++, DirectX 11, UWP) - How do I update the ByteWidth of a VertexBuffer without recreating it?

I want to have one buffer used for all dynamic properties but the amount of vertices in this could vary from just a few for an interface to the whole scene. As such if it's becomes initialized with ...
0
votes
1answer
44 views

Vulkan - preallocating chunks of memory and resource memory requirements

I would like to allocate a bigger chunk of memory and then suballocate from it but I don't fully understand how memory requirements work, is there a chance that when I allocate a piece of device local ...
0
votes
2answers
87 views

DirectX11 - CreateInputLayout() Vertex shader linkage problem

I keep getting the same error every time, I really have tried everything to fix the problem but it's still not working. Basically I'd like to draw a simple cube. The error(s): ...
0
votes
1answer
30 views

Replacement for glDrawElementsBaseVertex in OpenGL ES?

I am porting my game engine(c++) to Emscripten, which unfortunately only supports OpenGL ES 3.(Not 3.2) Therefore I don't have access to glDrawElementsBaseVertex, which is needed by my renderer(...
0
votes
1answer
70 views

Using GLFW and GLUT together

I'm new to OpenGL Lets say I create an OpenGL window using glfw and I need the UI feature from glut (such as popup menu). Is it possible to use glfw and glut in one program? Thank you
0
votes
0answers
43 views

How should I send large amounts of data from java to c++ (within the same process)

I'm writing a game that is mostly in Java (because that's the language I'm most comfortable with) while the graphics are in C++ (because of speed, and because the Vulkan API is hard enough to learn ...
0
votes
1answer
85 views

SDL Sliding Collision

I'm working on a 2D SDL C++ project, and I'm having a bit of trouble with collision detection. Currently the player collides with the edges of the level and with the SDL_Rect objects in the level, ...
0
votes
1answer
38 views

Rotate object around a dynamic object

I'm trying to rotate an object (shield) around another object (player) like this question. My use-case is this: I have players moving around a field. Their respective shield is orbiting in a constant ...
1
vote
3answers
178 views

How to efficiently store a large amount of data?

I am doing minecraft-like game. I have a limited world in size 32x16x32 chunk. Each chunk is a structure in which there is a three-dimensional array containing the values ​​of the blocks located in it....
0
votes
0answers
25 views

Light matrix issues

I have a simple school task, I need to draw an octahedron and a sphere with light in it. It works, but works weird I use this code 8 times with different coordinates to draw an octahedron ...
0
votes
1answer
34 views

I can't make the cube map to use shadow mapping - or it seems so

Basically, I'm following tutorials as I'm very new to OpenGL. I managed to perform shadow mapping towards just one direction, meaning I created 2D texture depth map. Now with omnidirectional shadow ...
1
vote
0answers
59 views

Doom-style 8 directions sprite math HELP C++ [duplicate]

I'm trying to get Doom-style 8 direction sprite rotation that changes its sprite depending on the camera and the forward vector of the entity just like this video here: https://www.youtube.com/watch?v=...
0
votes
1answer
154 views

Vulkan rendering of Minecraft-like world in C++

I decided on using 16x16x16 (4096 total) chunks of blocks. Problem is with textures. First idea was about texture atlas but it would require a lot of calculation and possible problems in dividing UV (...
1
vote
0answers
38 views

c++ text based football - how to have the cpu keep choosing a play from a menu until a condition is met

I am updating my post to include more of the code and cleaned up the function hopefully. I am trying to write a function for the computer to keep calling a play in a do while loop (which I am ...
1
vote
0answers
69 views

“Proper” way to do 2d scrolling game

I am new to game development and I would like to make a 2D scrolling game with a tile based engine. If you want an idea, it should resemble the Legend of Zelda: A Link to the Past like in the image: ...
1
vote
1answer
56 views

GLSL C++ Only first sampler array index is accessible

I have the following shader, which whose fragment shader contains a sampler array of 16 elements. Fragment ...