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

learn more… | top users | synonyms

1
vote
1answer
31 views

SDL Memory leak with TTF_Font and surface

I am creating 2D game with SDL2, and I have a problem with my label class. Every time I construct new label I have a memory leak, and I don't know what I do wrong! For example, I want to refresh ...
1
vote
2answers
46 views

OpenGL: Properly attach Texture

Problem: Been trying for hours to set a simple png of a cross hair as a texture (so I could later stick in the middle of the view like a normal cross hair), without luck. I'm coding in Java with ...
0
votes
0answers
20 views

Triangle in Directx 11 [on hold]

I recently got a triangle to work in directx 11 what exercises should I do to not forget how to do this and get a better understanding of rendering geometry?
1
vote
1answer
30 views

How to use GdxAI with libgdx ashley ecs framework?

I'm planning to use GdxAI Telegraph in GdxAshley ecs framework, my problem is how I'm gonna create a telegraph component if I wanted to dispatch a message? I have created AIComponent and AISystem. ...
1
vote
2answers
93 views

C++ MMO: Best approach to store creatures in a multi-level world map for the purpose to find spectators

I'm developing a game which is a multi-level game, my game can have a maximum of 15 floors, and a fixed amount of tiles width/height. Each tile in the map can have a creature. All fine until here; I ...
3
votes
1answer
34 views

Is this process for generating an OpenGL perspective projection correct?

I have been programming OpenGL for a while now and I have successfully created a perspective camera, however, I can't help but shake the feeling that I am doing it wrong. The code I am using is below, ...
1
vote
2answers
88 views

Performance Issues Using Lua in C++

I'm making an engine in C++ with Lua for its scripting language (using LuaBridge as the binding). I have a lot of entities and those entities have components. One of the components on those entities ...
1
vote
0answers
23 views

Integration of Game Loop + Physic Engine : when to delete objects?

How to manage code around physic engine, when a game object should be deleted? I will use a tiny game as an example:- 1st iteration of development I have a very simple game with 1 character (Jumper)...
3
votes
1answer
144 views

OpenGL contexts

I have several questions related to OpenGL rendering and the issues I encountered while making 3D enigne. Some of them were asked before, but the answers are old and possibly outdated or ambiguous. 1)...
-4
votes
0answers
22 views

Unreal crashes when opening a project [closed]

Issues opening the project. I think problem is either locating OwlGameMode file, or code in the file. I had the project open, and everything compiled and ran fine, but the project crashed when I ...
0
votes
1answer
35 views

How to keep text on top of openGL in a perspective projection

I have a game that has a score, I found out how to render text in a ortho projection but I can find a way to mix the two, or have text stay in the same position on the screen at the same time as ...
4
votes
3answers
122 views

How can I implement a file format that allows for random access to varying-sized sub-files?

I need to store and update collections of serialized data (of varying sizes) into a single file that is compact and allows for efficient random access to the stored data. Some real world examples: ...
2
votes
0answers
41 views

SFML Raycasting Problem: Textures not displaying propely

I have been lurking on gamedev.Stackexchange for a while now and finally have a question to ask. I have been working on a simple raycasting engine (like wolfenstein 3d) using the SFML Graphical ...
4
votes
1answer
69 views

How do I create 4 rows of SDL_Rects with each row being a different color?

So using a class i've created a vector and managed to make one row of SDL_rects(with collision detection and destroy on collision). But when I make a second row(and obviously 2 or more rows): 1) it ...
1
vote
1answer
48 views

What's a way to improve this wall collision detection code to keep objects within a perimeter made of these walls

// Player Collides with Wall counter1 = 0; for (iter60 = wallArray.begin(); iter60 != wallArray.end(); iter60++) { if (Player1.rect.getGlobalBounds().intersects(...
1
vote
0answers
51 views

How to manage millions of game objects with a Slot Map / Object Pool pattern in c++? [migrated]

I'm developing a game server for a video game called Tibia. Basically, there can be up to millions of Objects, of which there can be up to thousands of deletes and re-creations as players interact ...
1
vote
0answers
28 views

Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
1
vote
1answer
70 views

Simple 2D Platformer Collision Detection?

I'm relatively new to programming and I am attempting to write a 2d platformer in C++ using the SFML library. The structure of my code is that I have a Stage class which contains a vector of sf::...
0
votes
1answer
57 views

How to create animation using sprite sheet in C++ and SFML 2.0?

I was wondering how do animation using a sprite sheet. I have a sprite sheet and the size is height:400 width:601 The code I am using is: #include<SFML/Graphics.hpp> #include<iostream> ...
-1
votes
1answer
47 views

Volumetric Lighting/Light Shafts in DirectX

So currently I am trying to implement Light Shafts into my DirectX Engine. I read the Nvidia GPU Gems Article (http://http.developer.nvidia.com/GPUGems3/gpugems3_ch13.html) I am new to Graphics ...
0
votes
0answers
37 views

UE4: Multiplayer Projectile Hit Detection Problem

I'm trying to do Projectile Hit detection in multiplayer game. I'm using next approach: On the server side I'm storing all character's positions with world timestamp(PositionUpdated method). When ...
2
votes
1answer
98 views

C++ SDL OpenGL minimise / restore window issue

I'm partway through developing a 2D game in C++ using SDL and OpenGL; my IDE of choice is CodeBlocks. I've hit an issue that I can't seem to get around. Basically, if I minimise and then restore the ...
0
votes
0answers
43 views

Cocos2d-x v3.12 compile fails

Question duplicated from Stackoverflow, sorry don't know how to move questions between stack sites. Recently updated Cocos2d-x to v 3.12 and created the "Hello World!" project but the CLI command ...
0
votes
1answer
40 views

SDL: Certain bitmap not displaying

I have come across a very wierd problem. Here is my code: #include <iostream> #include "SDL.h" using namespace std; class MyGame { public: SDL_Surface* image; SDL_Surface* window; ...
0
votes
1answer
47 views

OpenGL vbo black screen

I am using sfml with opengl and using glew Here is my code: // MainWindow.cpp // window is declared outside in the class it is a sf::Window #include "MainWindow.h" #include <iostream> //#...
1
vote
0answers
22 views

SFML Texture issue removing from memory

I am currently working on loading tmx levels into my game, all is going well and i have layers being loaded textures being loaded and all the data being loaded such as level name, tile sizes etc. The ...
1
vote
0answers
42 views

Inconsistent read violation when using game state machine [closed]

I am getting some very inconsistent read violation errors with my FSM. It is very hard to reproduce but it always happens when the FSM is switching between states. It breaks at this block: void ...
-1
votes
0answers
25 views

Guidance on improving a Weapon Equip/Weapon Using system for a text based game

I’ve been working with C++ occasionally in my spare time and have completed a few small projects and I feel confident enough to start working on a larger project. I am making a command prompt text ...
0
votes
0answers
20 views

Passing heightmap data to btHeightfieldTerrainShape constructor

I was searching for a couple of hours, but I didn't find final solution, after trying many ways. I'm trying to get heightmap heights data, and pass it to btHeightfieldTerrainShape. Let's say my ...
1
vote
0answers
94 views

Isometric map (2D) - Click detection - Mouse mapping - How to implement it? [duplicate]

I'm building an isometric engine. I use TILE_SIZE * TILE_SIZE (minecraft like) tiles. (I'm using 64 * 64 tiles but I can change the number when I want) I can access for each tiles to this ...
3
votes
0answers
67 views

Geometry Shader crashing

I keep getting some strange errors in my Geometry shader and when I search for the cause of the errors, it returns nothing substantial. Here is the code. Shader #version 450 core layout(triangles) ...
0
votes
1answer
33 views

UE4 - openGL context

Is there a way to get an openGL context to do my drawings in UE4? I'd like to use some shaders before the loading of a scene (kind of an intro thingy), but I couldn't find anything related to get an ...
0
votes
1answer
49 views

C++/SDL Snake Game: Drawing Tail Crashes Game

I"ve been making a snake game in C++ using SDL (first game and first time using SDL), and I've run into a bug. As the tail of the snake gets longer, the game slows down (snake gets slower), and ...
0
votes
0answers
35 views

How to create a rectangular grid of triangles in openGL

I'm using OpenGL, GLFW and GLEW to create a simulation of water waves for a school project. I'm using a textured grid and will manipulate said grid in the vertex shader. I tried to create the grid by ...
1
vote
1answer
55 views

Quaternion based camera pitch freaking out, and Z-axis drift

This is the code I use to control my (first person) camera's movement and rotation. Translation successfully keeps orientation in mind, so that up and left and such are always in the expected ...
1
vote
0answers
13 views

Cocos2d How do I transition to a scene

So I have mainScene and I have LogoScene, I am wondering If i can make logoscene show a logo, then transition to mainscene. here is what i have import org.cocos2d.layers.CCLayer; import org....
-3
votes
0answers
70 views

C++ Optimizing .obj Parser

I am wanting to make an OBJ parser as efficient as possible but am having some difficulties. I have played around with different ways to read my .obj files and have found reading them in binary is the ...
0
votes
0answers
58 views

GUI, interface/listener equivilent in c++

brief intro I am currently working on a game engine using SFML for a small project, Coming from Java I know a fair bit but unfortunately I have come across a lot of snags (to be expected when ...
5
votes
1answer
65 views

Check if thread has OpenGL context

I'm looking for a way to check if a thread accessing a namespace function has a OpenGL context attached to it. I have looked around and all I can find is, GLFWwindow* glfwGetCurrentContext(); Which ...
1
vote
1answer
80 views

C++ class hierarchy issue [closed]

I am taking the step of moving on from Java over to c++, I have been working on my own custom game engine in java for a while so have a good understanding of polymophism, inheritance etc. Now to the ...
1
vote
1answer
39 views

Setting sound panning

I'm trying to set sound panning in my game depending on camera position, rotation and audio source position. I was able to set sound panning depending on camera position (listener), and audio source ...
1
vote
1answer
39 views

What's an optimal procedure to create a connected cyclic grid of nodes and edges for A* pathfinding

like the title says, I'm trying to create a grid of nodes that hold edges or connections to each other so I can perform A* algorithm to have objects traverse across them as seen in your standard RTS. ...
3
votes
2answers
151 views

How to use Irrlicht game engine in cygwin?

How can I develop a game with Irrlicht game engine in a cygwin environment? I tried google, but honestly I didn't find any useful tutorials about setting that game engine in cygwin. Thanks, Ehsan.
0
votes
0answers
47 views

How to make Level Editor in C# for a DirectX engine in C++ [duplicate]

I have been trying for months to make a Level Editor for my C++ DirectX Engine. I have tried using a C++/CLI wrapper or P/Invoke to do this. Neither seems to work. Can someone let me see a sample of ...
1
vote
0answers
24 views

Getting Display Name via Steam ID for Non-Friends

When using the Steamworks SDK (in C++), is there any way to get the display/persona name from the CSteamID object, even if we are not friends on Steam? Or is this possible for friends only? In that ...
2
votes
0answers
129 views

How to “hot-reload” a glsl shader

I am wondering if its possible to dynamically change shaders while the code is running. In my game, I want to have a development mode in which users can change the shader source and dynamically see ...
1
vote
1answer
232 views

How do I render my DirectX C++ engine to a C# Panel?

The title pretty much sums it up. I'd like to know how I can get the HWND of my C# Panel object to my DirectX engine so I can render to it. I know it involves making a C++/CLI wrapper, but I'm not ...
1
vote
0answers
45 views

When to Use Spatial Hashing vs Bounding Volume Hierarchy?

I've been slowly working on implementing a spatial hashing function into Bullet Physics to see how well it will work in my game engine as a general use. Though as I'm starting to design it, I do ...
3
votes
0answers
82 views

How can I fire a bullet from an actor's position?

I want to shoot a bullet from an actor. I know I need a location in space to fire a bullet from, which I've got in the form of a model set as an actor. Now I need to create a new object (in this case,...
0
votes
1answer
55 views

Cocos2d-x build failing on linux

I was trying to compile cocos2d-x on my linux machine, because they do not provide a binary copy of the library. However, I received the following error during the build: /home/ryan/Downloads/cocos/...