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

learn more… | top users | synonyms

0
votes
1answer
15 views

Problem with 2D matrix transform og shapes

I have set myself onto the task of creating a class BaseObject, which represents a graphics object with an associated shape as the member variable shape, which is a pointer an object Polygon. I'll ...
0
votes
0answers
34 views

Game written using C++, OpenGL 4.4 on SDL doesn't drop frame rate but runs in slow motion [on hold]

Our game written with C++ on SDL using OpenGL4.4 has a fantastically weird bug. When the game is run for enough time, things begin updating in slow motion. The framerate is still 100fps - 90fps, but ...
0
votes
0answers
30 views

Calculating Bounding Rect

I'm trying to clone space invader of atari and I have problem with bounding rect calculations.. the rect is not correctly bounded.. maybe I have problem with the transformations void ...
0
votes
1answer
75 views

How should I choose between Vec3 and Vec4?

I find myself torn between using Vec3's vs Vec4's for representing position, directions, etc in my non-gpu code. I see the obvious benefit of using Vec3s for stuff like data in buffers, to more ...
0
votes
0answers
18 views

Debug vs Release memory [on hold]

My game runs fine in release mode, but in debugging mode if i get too much objects on screen it slows down game fps and the game can get very slow. I am using vstudio and c++ language, is there a ...
-1
votes
0answers
28 views

Basic concept of SceneGraph [on hold]

Is there anyone who can explain me the basic concept of the scene graph? thank you
-1
votes
0answers
28 views

Error MSB6006? “fxc.exe” exited with code 1 [on hold]

Allright, so I fixed my problem with Entrypoint Error, but now, I have another problem. When I want to build my application, I get this error: Error MSB6006? "fxc.exe" exited with code 1. My ...
0
votes
1answer
22 views

DirectX RenderTargetTexture bound to both RTV and SRV

After following the 22th tutorial of Rastertek. I and some others on the internet have had an error. Despite following the tutorial to the letter. However, the answers to this error message have been ...
1
vote
4answers
319 views

Object orientated design for RPG character creation

This question may not be helpful to some but I'll ask anyway. I've hit a bit of a object orientated design issue. Making a RPG and the user gets to choose their own class i.e warrior/rogue/etc. ...
0
votes
1answer
40 views

Organizing a Transform class to internally use quaternions

So, I'm interested in building a Transform class similar to the one used in Unity Engine, but in C++. My intent is for it to be user-friendly to change the position, rotation, and scale of a variable ...
1
vote
1answer
35 views

How do I destroy a SDL_Finger pointer?

Hello I'm using SDL with C++ and I got this code: void handleEvents() { SDL_Finger* finger = SDL_GetTouchFinger(SDL_GetTouchDevice(0), 0); } I do not know what SDL does inside the GetTouch ...
0
votes
0answers
13 views

C++ - Error X3501 Main Entrypoint Not Found [duplicate]

I was developing my DirectX 11 app, but when I wanted to add a function to draw a triangle, I get this error from compiler. Error X3501 Main Entrypoint Not Found This is how my main .cpp looks ...
0
votes
0answers
43 views

Preferred way to integrate box2d with SFML

I'm trying to integrate Box2D with sfml. My current solution is to have overloaded functions creating sfml shapes from box2d fixtureDef shapes. I store created sfml shapes under the name 'visual' in a ...
-1
votes
1answer
39 views

How to handle pathfinding and path following with sprites the same size as the grid?

The game I am working on is currently using 32X32 collision boxes. I have implemented a working AI (A* - path finding method) which is based on the Grid Size. Lets say that I use that 16x16 grid , ...
1
vote
1answer
94 views

C++ Entity Component System: Diverse Behaviours

I'm trying my hand at an action RPG kind of game and using a modified version of entityx from alecthomas, which is basically an Entity Component System. I have really big troubles with some of the ...
0
votes
0answers
31 views

loading a model, which has multiple meshes using assimp

I have been using Open Asset Import library(assimp) along with OpenGL API to load and render 3D models. I followed some tutorials and have got the output as expected. But, I have failed to understand ...
-1
votes
0answers
50 views

What should I start with [closed]

I started learning C++ a while ago, and I wanted to make a simple game. I don't need it to have networking or even graphics, I would be okay with a text-based game, but where should I start; should I ...
0
votes
0answers
35 views

SDL Handling random collision boxes and AI path Finding

as the title says i want to present here mine approach to map and collision generating in SDL. Currently the map is generated by loading an HD picture of a map from Zelda. Then i made a simple map ...
0
votes
0answers
21 views

How can motion/simulation be suspended for a given orientation of the body in bullet physics?

I am currently trying to make a Ragdoll and it falls to the ground obeying constraints as expected but it never actually comes to rest. The rigid bodies appear to vibrate and the Ragdoll starts moving ...
2
votes
1answer
71 views

Is there a way to manipulate a pixel Array on the GPU?

I'm currently working on a 2D-Game and i want to draw and calculate the whole screen myself through a pixel array. I'm programming in C++, using SDL 2 and OpenGL specifically a OpenGL Texture which is ...
0
votes
0answers
43 views

C# to C++ using SimpleMath [closed]

SimpleMath It provides the following types, with similar names, methods, and operator overloads to the XNA Game Studio math API Oh, good. If that sounds horribly confusing, the short version ...
-1
votes
0answers
33 views

OpenGL - Problem rendering multiple meshes [closed]

I'm building a graphics engine that loads models using Assimp. I can load and render single meshes just fine but when i try to load a .obj model with multiple meshes i can't render the whole model. ...
0
votes
0answers
67 views

First game engine? [closed]

I'm new here I hope this question doesn't violate any rule, anyway... I have a good knowledge of C++ and I'm really interested in game development. Now more than games I would like to make a small ...
0
votes
1answer
25 views

Cocos2d - Physics bodies randomly loosing Velocity along an axis after impact

This just started occurring and seems to randomly happen during, and between, game sessions. A dynamic moving body collides with a static body and instead of bouncing off looses (almost completely) ...
0
votes
1answer
33 views

calling joystick's force effects in C++

I want to use c++ to call the joystick's force effect if it leaves the parameters. I'm using Logitech Force 3D Pro. For example, when the joystick's cursor goes outside the box, I want the joystick to ...
0
votes
1answer
76 views

Why must SDL compile as a dll

I'm using SDL for some small games I work on, and I have tried to no avail to change the compiler settings from compile as a dll to a 'normal' project. So my question is, why must SDL compile as a ...
0
votes
1answer
55 views

PointSprite in DirectX9

I was trying to implement a particle system using PointSprites. Draw calls return D3D_OK but I don't see any particle on the screen. I'm not using Vertex Buffer for the particles, but I use two ...
1
vote
0answers
13 views

Full-motion transparentized video clips

This is sort of a question following onto a previous question I wrote specifically targeting XNA. Understanding that it's an involved enough process that I'd want to manage memory myself, I'm now ...
0
votes
1answer
21 views

How do I center the view around specific coordinates in SFML

I want to use sf::View in SFML in order to change the position of the view, such that the player sprite is always in the center of the screen. Thus I want to write a function which allows me to input ...
0
votes
1answer
31 views

Can I display text in SFML without setting a font?

I'm trying to render text without setting a font. #include <SFML/Graphics.hpp> #include <iostream> using namespace std; string culoare; int main() { sf::RenderWindow ...
0
votes
0answers
36 views

blasting an explosion like space invader

I'm trying to clone space invader, especially the part where you hit the green barriers and there is a small black blasting explosion that occur. https://www.youtube.com/watch?v=437Ld_rKM2s I have ...
0
votes
1answer
36 views

First Person Camera Target

I have a camera at position P, and a normalized direction vector D (where the camera is facing). I want the target of the camera to be 5 units forward from the position. Here's my attempt: F = (0, 0, ...
0
votes
0answers
16 views

Reading Color data from UTexture2D in UE4

Here's my code: // get RenderTarget2D static ConstructorHelpers::FObjectFinder<UTextureRenderTarget2D> TargetObj(TEXT("/Game/Textures/RenderTexture")); // generate a UTexture2D CameraTexture = ...
0
votes
1answer
39 views

How to make a stereoscopic 3D Game with SDL for iOS

I was looking up google for an answer the whole night but didn't find anything. Yesterday I found some VR demos and games on the AppStore, with stereoscopig (dual rendered) screens. So you put your ...
1
vote
1answer
109 views

C++ DirectX FBX SDK Importer Weird Mesh Problem

I'm having a problem understanding how to render the vertex data in fbx model into directx. This is my two functions and I've already triangulated all the mesh nodes. bool ...
-1
votes
2answers
43 views

Change sprite position

I have Sprite and i want change my Sprite position when score == 2 score = 0; auto bird = Sprite::create("bird.png"); bird->setPosition(Point(-visibleSize.width, ...
3
votes
3answers
176 views

Possible A* Optimizations [closed]

I have implemented A* in my game. However, I am not happy with the performance and need some help deciding what to do next. I have already done the following optimizations: Not having a closed ...
-1
votes
0answers
69 views

OBJ Loader Incorrectly loads textures

I have this OBJ loader function that I have created within my Object class that loads in an *.obj file and when the object is rendered onto the screen the textures seem to be loaded incorrectly I ...
0
votes
1answer
50 views

Multiple Vertex Layouts

I have different vertex layouts I'm using to render things in DirectX and as of now I've just used the same vertex layout for every mesh I load in. But now I want to have the vertex layout change ...
3
votes
1answer
126 views

glBufferData consuming system memory

I am memory profiling my game in Visual Studio and about 60% of memory usage is happening from calls to glBufferData(). I may be missing something but should this consume GPU memory instead of system ...
0
votes
1answer
36 views

Immovable object impact physics

I am trying to do some physics calculations from scratch, and as a result am creating a small bouncing ball example. However, I have some issues getting correct results from my impact physics when the ...
0
votes
3answers
41 views

How Use loop's in cocos2d-x

I've for loop which work well on Windows double speed = 35; for(int i=0; i<60 ;i++){ speed += 0.3; Sleep (1000); // sleep 1000 mili seonds } But it responds an error ...
1
vote
1answer
37 views

Open OBJ files with OpenGL c++ [closed]

I need some help because i'm trying to open a obj file with Code Blocks. Im already downloaded the requirements for OpenGL and GLUT libraries. somebody knows some basic and specific steps to do it?
0
votes
1answer
42 views

explaining collision check code

I came across the following code in a game book but I can't get it, does it check if a point ( left,top) in a rectangle? bool CheckCollision(float left, float top, float SpriteX, float SpriteWidth, ...
0
votes
1answer
43 views

How to serve user generated levels? [closed]

What is the easiest way to store online and serve user-generated levels? What client-server architecture should I use? Will I need backend code, or just a database? What database would be the easiest ...
1
vote
1answer
69 views

Averaging normals, or tangents

I am using a library to load an obj but it doest compute the tangets for each vertex, which I need for normal mapping and pom. I computed my tangets, and bitangents, everything appears to be fine, but ...
0
votes
2answers
38 views

Segmentation fault adding SDL_Surface

I'm trying to add a new SDL_Surface to my whack-a-mole clone code but even if I set it to null it wont let me. game.h #include<SDL2/SDL.h> #include<SDL2/SDL_image.h> ...
0
votes
2answers
46 views

Colour values of a pixel array from a spritesheet image wrong (C++, SDL2)

So basically what i want to do is create a 2D tile based rendering system in C++ that renders each pixel on the screen manually. Rendering an individual pixel on the screen works just fine (or render ...
1
vote
0answers
66 views

glGetUniformLocation returns 23724032

as the title says, I have a problem using glGetUniformLocation call that returns, for the following code, the value 23724032. I'm writing a little engine and the draw function of my models is: void ...
1
vote
1answer
81 views

Static SFML 2.2 libraries and Code::Blocks on windows 7 [closed]

I am starting to program games for the first time, but I've been doing general programming for a couple years now. I have Code::Blocks, which I am fairly comfortable with, but now I am struggling with ...