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

learn more… | top users | synonyms

0
votes
0answers
22 views

Pleats and folding

We have a C++ module that produces mesh dynamically and simulates it with a physics engine. We want pleats on the surface of our mesh, pleats that remain sharp and folded during simulation while ...
0
votes
1answer
91 views

Best way to structure SDL2/C++ game? [closed]

I was reading some SDL2 tutorials and I noticed that you need to pass your window surface handle to any drawRect calls. Should I create a global surface handle or pass the handle by reference into ...
0
votes
1answer
127 views

How do you build a rotation matrix from a normalized vector?

I'm trying to find the correct way to build a rotation matrix from a unit vector. I have two arbitrary points in space (p1 and p2), and I'm trying to create the vertices for a rectangle to span ...
3
votes
1answer
62 views

Dynamically generating triangles from points

I'm working on 2D lighting. I have a list of points that have been calculated and when I draw lines from the light origin to the point it works. The problem is connecting the points into triangles. ...
0
votes
0answers
71 views

C++ timer for game loop(consistency across machines)

sorry I have been searching for ages and can't seem to get a good answer that I can understand, I am trying to make a game in my universities TL engine, and I can create a timer class fine, but I'm ...
1
vote
0answers
38 views

Drawing multiple polygons with vertex buffer object

I tried to create program in which I would draw multiplepoygons here is fragment of what I have done: GLuint VertexArrayID; exampleof drawing triangle(I have more polygons, like circle, and so ...
1
vote
0answers
17 views

Updating aiScene in ASSIMP with skeleton data

I am working on a project where I take an unrigged closed mesh, import it using ASSIMP, auto-rig it using the algorithm provided by Ilya Baran and Jovan Popovic and again export it using ASSIMP. I ...
0
votes
2answers
137 views

Switched from immediate mode to VBOs, game runs slower

trying to improve draw performance on my c++, OpenGL, SDL game. Back in school we mostly learned immediate mode, so thats how my drawing was originally implemented. When I started reading up online ...
0
votes
0answers
30 views

Open gl blending problem c++

im creating project from nearly scratch in c++.. i created skybox and terrain . the result is catastrophic ! the terrain goes away and the ground also goes away,i dont know why ! i tried to disable ...
-1
votes
1answer
78 views

C++: from LWJGL to C++ with OpenGL

I've been trying my best on porting my 3D game from Java to C++, but to no avail. I use only LWJGL with OpenGL but I cannot find any other library in C++ that supports as much as LWJGL does for Java. ...
0
votes
1answer
219 views

AABB Collision Problems in SFML

I have a problem with AABB collision. I am making a top down rougelike in SFML and my collision algorithm does't quite work properly. HERE IS A GIF OF THE PROBLEM. It mostly works, except for when ...
0
votes
0answers
78 views

How can I improve my ray casting algorithm

So I finished coding this ray casting algorithm in C++ and I feel like it could be improve, despite that, I believe that it is really good since it is coded using SFML. Here is the algorithm in C++ ...
0
votes
1answer
45 views

OpenGL dynamic font glyph cache library

I have begun work on an OpenGL application (all on my own and with little knowledge) and started with FTGL, rendering true type fonts, which, with alot of text has a great impact on frames per second. ...
0
votes
1answer
64 views

directX rotation of a 3d cube inconsistent

i'm trying to develope a simple 3d cube in directX that can be rotated in any direction by dragging the mouse. It works in the following way: i drag the mouse to the right or left, and the cube ...
1
vote
1answer
86 views

How can I render a texture to a polygon in SDL2? A fake 3D problem

I am working on a fake 3D game recently. The game is based on the perspective principle and using angular perspective. Here is a screen shot: But the problem is that the walls and floor displayed ...
4
votes
0answers
98 views

Windows vs OSX Performance with SDL, OpenGL [closed]

I have been writing an SDL OpenGL game in c++ for a couple of years now, writing my own engine for the most part (using Box2d for physics). I'm primarily a mac user, so I've been using xCode to write ...
0
votes
1answer
36 views

Is there a 'wait' function in Allegro5?

I am creating a game in allegro5 and I have come across a problem. I have a character that fires a shotgun and there needs to be a delay before he can shoot again. The code for shooting his gun is in ...
-3
votes
1answer
78 views

Creating a Zelda-like map in pure C++ not working [closed]

I wanted to create a map like in Zelda, but it keeps showing hashtags instead of 1 on A1 and I don't know why. vector <string> A0 {"#","#","#","#","#","#","#","#","#","#"}; vector ...
0
votes
1answer
63 views

OpenGL texture 2d array won't render with depth > 1

Below code uploads my texture memory that's described in the passed parameters. When 'vPixelData' only holds 1 item/texture it is rendered properly, but once there's 2 or more nothing shows up. ...
0
votes
2answers
87 views

passing a class type as a parameter [closed]

I have a setup in my game engine where I can add behavours to game objects. All behaviours are based on the class AbstractBehaviour. To easily get access to behaviours from a game object, I am trying ...
0
votes
0answers
41 views

Get Mouse Location With Respect to any Camera/Object in Unreal

Am Currently working on a VR Project (First Person Shooter) where the Player can shoot any where on the screen. Am using Scene Capture to Texture method. The VR part is working fine. The Problem am ...
1
vote
0answers
46 views

Implementing Browser in Unreal Engine 4.10

I am looking to add some oauth to a game I am working on. I can get the user auth to work in the browser that comes with UE4, however there is not any capability to detect changes to the currently ...
0
votes
1answer
59 views

OpenGL GLSL vector of sampler2D

If im trying to create an obj. file loader in c++ and draw it with opengl i need to use multiple textures in the fragment shader.I know i can just use: `uniform sampler2D Texture1` `uniform ...
0
votes
1answer
54 views

How do I calculate a vertex's position on the CPU?

I'm creating light processor and I need light position and vertex position after translating, rotating and scaling (to calculate distance between them to check if light is affecting my vertex ...
1
vote
1answer
57 views

Mesh slicing/knifing with multiple planes

I have a ginormous mesh which I want to cut with multiple planes. For simplicity I want to know how to cut a mesh with single plane and repeat the logic. Consider a X-Y plane of coords (1,1,0,0) = ...
0
votes
1answer
83 views

C++ & OpenGL - Bad orthographic projection matrix?

So I'm trying to render 2D text in my Game Engine using programmable pipeline. Normally I'm using perspective projection matrix but for UI elements I'm trying to create orthographic projection matrix ...
1
vote
1answer
49 views

Swept AABB Collision and Response Problems

I am working on a simple 2D game, and I am having problems with collision detection and response. I am using code adapted from this article: ...
0
votes
0answers
54 views

Find which object is clicked on 3d scene

I am using GamePlay3D engine. I have on scene a couple of 3d objects and I want to make them clickable. How to find when I click which Node/Object contains given projection point? I tried with code ...
0
votes
0answers
22 views

Custom Scene Component Do Not Register Children

I have made a class that is derived from USceneComponent which contains 4 references for itself and two UStaticMeshComponents. Simply I am trying to make a tree structure. When I first create actor ...
0
votes
1answer
105 views

Modern OpenGL c++ obj loader

So i made a obj loader in c++.I used blender to export my files. I tried to draw 2 squares(one perpendicular to the other) and when im looking at them from above some weird black triangles apear, ...
0
votes
1answer
52 views

C++ OpenGL More textured objects equals less FPS

So I'm creating a game engine with many features, last time I focused on textures. When I finished implementing some new code (Made by myself) I created new Entity with texture, and it was working ...
6
votes
0answers
109 views

Design patterns for live coding/script reloading [closed]

I would like to make C++/Lua combo and write scripts for a game with live script reloading. What design patterns should I be aware of so not to cause me unnecessary pain? For example if I have a ...
0
votes
1answer
86 views

Port forwarding client and server?

So, lets say i have a client and server sending information to each other. Do i have to port forward both the server and the client, or do i just port forward the server? If i have to do both, is ...
1
vote
0answers
105 views

One big asset file or many small asset files?

I'm working on a game and I'm wondering if it is better for performance and memory usage to have one large file containing all my assets (the assets are in a custom format) with a look up table at the ...
0
votes
1answer
135 views

How can I save and load an adventure game?

I'm using cocos2dx and sqlite to store datum. The table looks like this: x INT, y INT, className TEXT, properties TEXT. I use json to serialize terrains and sprites. But I don't know how to ...
0
votes
2answers
178 views

Modern OpenGL project in c++ .obj loader

I want to create a class in c++ that loads a model with the obj format.The model gets generated from Blender(3D modeling program).When i try do draw something on the screen without the class(all the ...
0
votes
0answers
80 views

A 2D card game using OpenGL

I am creating a 2d card game. I have written the low-level functions, game logic, game algorithms in C++. I now have to create a graphics layer that the player can interact with. This just has to be ...
0
votes
0answers
114 views

How do I draw a tilemap in SFML (C++)?

I've been working with SFML and I've used what I know to try and create a TileMap. However, opening the RenderWindow will only display a black screen and the image I have loaded in the files will not ...
1
vote
0answers
27 views

Adjust the Camera Viewport Rect in Unreal Engine

Am new to Unreal Engine. I want to adjust the Camera Viewport Rect so that the camera will render to half of the screen. This is achieved in Unity by changing the Camera Viewport Rect property. How ...
0
votes
1answer
110 views

C++ Additive Blending Algorithm 2d Game

I was wondering if anyone could shed any light on whats going wrong with my additive blending here, I think I'm nearly there, currently my outcome is black squares. I have tried using both the ...
1
vote
0answers
124 views

Recognize pattern in 3D building environment

I'm currently developing 3rd person building game (as bacheleor thesis). I need to recognize constructed patterns co I can mark corresponding structure as some building (so player can start using that ...
0
votes
0answers
16 views

C++ Opengl rotation Rotating vector before transform still rotates around 0,0,0… In world position [duplicate]

So how should I get this to work in local position? (Ie, moving to 4,0,4 and rotating around 4,0,4 . (x,y,z)) Here is where I add models / verticies: glm::vec4 pos = glm::vec4(1.0); glm::mat4 ...
1
vote
0answers
40 views

Cell height with heightmap for collision detection

Hello everyone I'm programming a game with c++ and openGL. My world is generated from a heightmap (100x100 matrix with values 0-255) and now I need a function that returns the actual height based on ...
0
votes
0answers
9 views

Creating a Shop in the Game for alternative skins Unreal Blueprint [duplicate]

I'm a beginner developer and I'm trying to create a game with some alternative skins. So when the player gets sufficient money, he goes to the menu, open the shop, buy the new skin and select to play ...
5
votes
3answers
195 views

How to handle GameObjects that have been destroyed but are still held by others?

I'm developing my own game engine in C++ as a learning exercise. I have employed a fairly standard method of handling destroyed GameObjects: Mark them as destroyed Have the scene delete destroyed ...
0
votes
1answer
82 views

Can't set color of returned sprite? [closed]

So, I have some variables in my game : This is all the tiles in my game / the map. std::vector<Sprite*> tiles; This is the sprite variable which I have in a custom Sprite class. sf::Sprite* ...
1
vote
2answers
101 views

How do i set Lua variables?

You can pretty easily read variables, but what about writing them to the lua file? Ive given it a little go, but it doesnt seem to work... void Lua::setBool(string path, string var, bool val) { ...
0
votes
1answer
46 views

Storing and rendering Mesh Data in stl container

I'm trying to refresh my DirectX11 knowledge, and ran into a problem while trying to render multiple meshes instanced. What I want to do is give my ObjectManager class the name of an .obj file and it ...
1
vote
3answers
128 views

Get the tile that my mouse pointer is currently over?

I want to get the tile that my cursor is over in my game. I did some googling though most of the examples we're in other languages/libraries and if they weren't, they didn't work for me because I use ...
1
vote
0answers
23 views

Adding newly created objects into a vector inside the object? [closed]

Would some thing like this work? RawModel::RawModel(GLuint vao, GLsizei count) : m_VAO(vao), m_Count(count) { m_RawModels.push_back(this); } RawModel::~RawModel() { for (GLuint i = 0; i ...