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

learn more… | top users | synonyms

1
vote
0answers
21 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
33 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
0answers
28 views

developing game requirements [on hold]

I am a c++ programmer , and after 2 years and half learning c++ , I want to go in game development field ! I don't have even a clue , how to build a 2d game , like pong myself !i had experiences with ...
0
votes
1answer
42 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 ...
0
votes
0answers
45 views

How to automate testing C/C++ slot games? [on hold]

Sorry if my question is hella nooby in advance. I'm doing manual testing of slot games on actual virtual lottery terminals. I was wondering how can I automate test scripts? Is that possible at all? ...
1
vote
1answer
38 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
51 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
30 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
48 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
10 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
0answers
18 views

How do I play NSF files with SDL2? [on hold]

I'm learning game development with C++ and SDL2. I'm developing on Debian. I know SDL2 can't play NSF music out of the box, but are there stable extensions for it that will work on Windows, Mac and ...
0
votes
1answer
74 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
61 views

Obj file loader in c++ from blender [on hold]

So i want to export files from blender which have: triangles,normals,texcoords and materials.and use modern opengl and c++ to create a obj file loader.I also use sfml. I have a shader loader class ...
0
votes
1answer
47 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
94 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
50 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
84 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
112 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
0answers
30 views

Assimp setup in C++ CodeBlocks MingW compilator g++ [closed]

Im trying to learn game development.In the past i used old c++,opengl,and blender to create an obj file loader for my projects.Now i saw that this library Assimp is much better.But i have no idea how ...
0
votes
1answer
80 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 ...
-1
votes
0answers
48 views

Modern OpenGL class in c++ for loading model [duplicate]

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
38 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
35 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
16 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
85 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
97 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
36 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
154 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
76 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* ...
0
votes
2answers
87 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
37 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
89 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
19 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 ...
1
vote
0answers
19 views

Easiest method to setup a UI for an app, and use .cpp for the logic of the touch handling? [closed]

This is specifically for iPhone development, can I use Xcode for this? Is there more to it than just dropping in my cpp files? Are there simple alternatives to Xcode?
0
votes
0answers
19 views

Failed to understand how to use glm::unProject (OpenGL 4.3)

Situation: I use OpenGL 4.3, FreeGLUT 3.0, and GLM library. Let say i have a simple 2D object (a ball) and it moves accordingly to the simple equations: x = x_0 + v_0 * t * cosf(alpha); y = y_0 + ...
1
vote
1answer
40 views

OpenGL App not setting cursor position appropriately

I have written a small application using OpenGL, and have implemented some rudimentary camera controls. Unfortunately, I cannot get the application to set my cursor position correctly. The cursor is ...
-2
votes
2answers
109 views

C++ Multi-Platform (Windows, Linux, Android) OpenGL(ES) Solutions or Tutorials? [closed]

I'm sorry if this has been asked recently and I'm not Googling it right, but I've been digging all week for something. I've got a game prototype I made in Unity, and I have some decent experience ...
0
votes
1answer
69 views

How should I rotate vertices around the origin on the CPU?

I have tried using glm::rotate and such. glm::translate works fine, but rotate doesn't work (if I rotate before/after a translation). Here is my current setup: glm::vec4 Off = glm::vec4(0, 0, 0, 1); ...
1
vote
1answer
41 views

C++ Opengl transforming a glm::vec4 with a glm::mat4

Its easy enough doing it on the gpu via GLSL, but how would I do this in c++? When I try it gives me an error telling me I cant cast a glm::mat4 to float, Which makes sense, but how should I do it? ...
1
vote
2answers
104 views

Adding new components and systems in my ECS requires lots of boilerplate code

I'm writing an entity component system for a project I've been working on. It's currently in a working condition, and overall i'm pretty happy with it, but I've noticed that adding new components and ...
0
votes
0answers
42 views

What is the best way to group lots of squares into one VBO?

I'm making my first game in OpenGL, using procedural generation, and it is a similar concept to Terraria. At the moment, I have one, very small VBO for a square ('block') and an EBO for its vertices. ...
5
votes
2answers
116 views

How to apply friction vector to acceleration in top-down 2D game?

I'm making a top-down view 2D RPG game, meaning the player can move in any direction on a 2D plane, and I'm trying to implement a somewhat realistic non-orthogonal acceleration/friction physics model ...
2
votes
2answers
140 views

Möller-Trumbore intersection point

I am using the Möller-Trumbore method as part of my (still very basic) collision detection system. The information I'm craving about is the distance from the ray origin and intersection point. The ...
1
vote
0answers
39 views

Any tips on figuring out programming in Unreal Engine (without focusing mainly on blueprints, or at least a fairly even mix of the two?) [closed]

So for the past few months I've been attempting to learn Unreal Engine. Most tutorials feature blueprints which I guess makes sense as it's new and simple and their solution to artists trying to make ...
0
votes
1answer
34 views

Terrain Generation - Only draws first sprite and last row on the X axis

So, I have a problem where I'm trying to loop trough columns of sprites, that later will be drawn to fill a specific area. But it only renders the first sprite and the last row of sprites on the X ...
1
vote
2answers
103 views

How to stop sinking bodies in physics engine C++

I'm writing a rigid body simulation in C++, and have come across a problem when an object should come to rest on the ground. Because gravity is being applied to it's velocity, the object starts ...
3
votes
1answer
106 views

C++ A Star Algorithm [path takes wrong route] using <deque> & unique_ptr

I am having issues, trying to get my A Star algorithm working, the main problem is with my process of the algorithm, I am using something known as the TL engine which has some of its own datatypes and ...
0
votes
1answer
108 views

Looping trough a std::map won't work [closed]

Answer : Turns out the for loop did work. Lesson Learned : You might want to try putting something in it to see if the code inside actually executes.... As the title says I ...