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

learn more… | top users | synonyms

0
votes
0answers
24 views

Communication in a simple GUI (C++ / SDL2)

I've spent a few months now working on a fairly simply 2D game engine with SDL and C++. I'm now trying to develop a simple but well-featured GUI suitable for most games. Right now I'm really ...
-1
votes
0answers
26 views

Where should I start individual development? [on hold]

I'm not completely sure if this is the correct place to post this, but I need some guidance. I'm 15 years old, and a sophomore in High School. I want to either be an electronics technician or a game ...
0
votes
1answer
25 views

How to Load a Level for use with the Bullet Physics Library

I am trying to use a level in .obj format loaded with Assimp to generate a btBvhTriangleMeshShape to use with the Bullet physics library. I can successfully load btConvexHullShapes as well ...
-3
votes
0answers
42 views

3D Fractal terrain generation

I have a problem with my terrain, each time I get a strange terrain. I don't know where is exactely the problem. Here is my MidPoint dispacement function: bool terrain::MPD(int x1,int y1,int x2,int ...
0
votes
0answers
21 views

OpenGL - Cubemap “Rotating” Proportional To Camera Movement

I'm doing a simple planet rendering project and am running into an issue with accessing cubemap textures correctly. The planet terrain is generated using the diamond square algorithm done 6 times and ...
0
votes
0answers
25 views

I have a questions about c++ and SDL2, openGl [on hold]

i started to learn programing. I really want to make a game in c++11 and SDL2 , openGL i know is very hard to make something that why i'm asking this you know couple of good tutorials or books i can ...
1
vote
1answer
32 views

Modern OpenGL Texture Displaying Incorrectly

I've been working with this code and have simplified it to the most basic form possible, and even then I cannot get a texture to display properly at all. Here is the code: ...
1
vote
0answers
49 views

Improving performance for flocking behavior?

I have a game that I am trying to make. It is a twin-stick shooter that I want to design to have a LOT (Up to 500) of enemies on the screen. The game's base design comes from that of Geometry Wars, ...
1
vote
3answers
86 views

How does Unity call “update()” in the scripts?

I understand that you can expose your C++ code to a scripting language such as ChaiScript. From this you can call code that you've made in C++. In Unity, however, they have functions in the script, ...
0
votes
1answer
61 views

Handling input with callback functions

I'm not sure if I understand callback functions completely - they are functions that another function calls? This seems like a powerful tool, especially w/r/t handling input. I've written up this ...
0
votes
1answer
79 views

How can I store additional attributes on DCEL edges?

I am currently working on a city generator, and I've ran into some issues with data storage while working on the roads. I currently use a doubly-connected edge list (DCEL for short), to store the road ...
1
vote
1answer
49 views

3D GUI Shader Problem

So I want to create one of these in my directX11 project. The little axis there that shows you the direction. I have a nice 3d shader for my world geometry that I tweaked from Frank D. Luna (He ...
-2
votes
0answers
73 views

How to draw a curve in opengl [on hold]

I've just started learning OpenGL. With OpenGL I am trying to draw a car model with programming language C++. In this model I can not draw the curve in the car body where the tires will placed. I've ...
0
votes
1answer
77 views

DirectX11 Equivalent of OpenGL code

I am currently porting parts of my engine over to D3D11 from OpenGL and was trying to figure out how I would accomplish the following blending functions in D3D11. glEnable(GL_BLEND); ...
35
votes
5answers
3k views

When prototyping, how can I more easily explore game behaviour?

I build indie games myself, but I'm usually out of energy once I've taken a newly developed game to a level where it's possible to play with behavior, so I settle for refinement instead of ...
0
votes
0answers
47 views

C++ or C# for 2D Game Development [closed]

I am a python programmer since two years and I wanted to delvelop a REAL game now. So I decided to choose between C++ and C#. I should also mention that I mainly want to program games compatible on ...
1
vote
2answers
58 views

SDL draw dynamic select box

this might seem obvious to many, but I'm stuck and I cannot find any tutorial which helped me, so it would be great to find the answer here. I tried to make a rectangle like you have in RTS games, so ...
0
votes
0answers
31 views

Ideas for a seminar in computer graphics [closed]

I'm about to enroll in an "Advanced seminar in computer graphics" as part of my MSc degree in computer science. I'm relatively new to computer graphics, I'm currently in the middle of taking a basic ...
0
votes
1answer
36 views

Solitaire Game: Transferring Cards Design in C++

So, I'm working on a Solitaire game. I already created a the classes: Card, Pile, Stock. Each work as expected on it's own. My question is: What possible design for managing moving card(s) between the ...
0
votes
1answer
50 views

SDL pixel access very slow

I'm using SDL and need to plot pixels one by one on the screen. When I do this, it's extremely slow. I followed the tutorial here: http://www.programmersranch.com/2014/02/sdl2-pixel-drawing.html ...
0
votes
2answers
57 views

How to keep a shape inside a rectangle

So i'm making a game which is based on randomly generated rooms and i need a way to keep the player inside them and make the player glide when he collides with the room's bounds. I currently have a ...
0
votes
0answers
19 views

SAT MTV collision resolution jittering [closed]

Edit: I have updated my approach a bit, but now the problem is that if i'm outside a wall i stick to it, basically i get the Desired vector of motion and move there. Also how would i adapt this ...
-2
votes
0answers
38 views

CEGUI 0.8.4 and SDL2. Crash the app after startup [closed]

Do not run the compiled lesson. Link to the lesson. https://bitbucket.org/lucebac/cegui/src/ea8f8c814a4d5dbaa56344218659eb68ce173961/application_templates/SDL2.cpp?at=application-templates-devel Link ...
-1
votes
1answer
31 views

How do i load, render and trasnform 2D images using Direct3D 11 API? [closed]

In my small game project using DirectX 11 API, I created a Direct3D device, and can draw 3D meshes, using web tutorials and a book. But I cannot figure out how to load, transform (rotate, scale, ...
3
votes
1answer
135 views

How do I create a multiplayer server also suitable for local single-player?

I've created a voxel game in C++, OpenGL and SFML, and I want to make it multiplayer. I'd like to make it similar to Minecraft's client-server model: The single-player is just a client to the hidden ...
-1
votes
0answers
25 views

Why are my GLUT/GLEW models only visible for one frame in the framebuffer? [closed]

I'm having this problem with an OpenGL program where the models in the scene are only visible for one (the first) frame when rendering them to a texture, and then to the screen. If I render them ...
-1
votes
1answer
75 views

How can i fix my Ground detection code?

My ground detection works by checking if the player's x position is between the range of a sprite xpos+16 and xpos-16 if it is,then it uses a separate axis theorem on the y axis to see if the player ...
1
vote
2answers
106 views

Movement in gameloop

I wonder what the best way is to move the player. Is it best to always check for movement like I do in the first example of is it better to only access the movement function via the input function ...
1
vote
2answers
108 views

Proper Text-RPG Monster Generator [closed]

I'm making a text-based RPG in C++ just for fun, and in a way that I can keep adding to it and hopefully give it graphics one day, and I've got a lot of code for everything. My only problem is that I ...
0
votes
0answers
103 views

Problems with First Person Camera in C++ OpenGL

I'm building a first person camera for my application but I'm having a couple of problems relating to moving the camera. In general, I have 2 vectors, one for the camera's position and one for the ...
1
vote
1answer
140 views

Simulation of ball movement in a 3d landscape. The easiest way?

I have a landscape(generated via Perlin noise) and a ball. I want the ball to move along the geodesic(implementation of basic physics: gravitation, friction). I thought to do raycast around the ball ...
2
votes
1answer
80 views

Creating polygons with separate outline/fill colors in OpenGL

Subject I am creating a terrain map with triangle strips and I would like to make the bodies of the triangles black, but have their outlines be colored. Problem The solution appears to be to draw ...
0
votes
0answers
33 views

How can I create a collision like the ball and peg in Peggle?

I'm making a game which requires the same type of collision as Peggle. I know of the 3 main types (elastic, inelastic and perfectly inelastic) but those result in both objects moving after the ...
0
votes
1answer
44 views

How to figure out if I'm on the right path [closed]

I'm a software developer from Israel, I've been programming professionally since 2011, my first job was in HP software and lasted 2 years after which I decided that I want to pursue my dream in ...
0
votes
1answer
34 views

How to load in meshes efficiently into DirectX11

I wanted to know if there was a standard and efficient method to load meshes from a file into DirectX11. Currently, I'm loading .obj's by parsing them in and storing their information into a vertex ...
2
votes
2answers
96 views

How can I set up an intuitive perspective projection/view matrix combination in OpenGL, using GLM?

Could anyone help me set up an intuitive perspective camera matrix using OpenGL and the GLM library? By "intuitive" I mean that I want the camera to be looking at the middle of the screen down the -Z ...
1
vote
0answers
64 views

Directx 11 full screen

I build simple directx 11 application in c++ that draw square to screen. Also check in the end of the program when I close the last peace of directx the number of free reference. This work great in ...
0
votes
1answer
80 views

OpenGL Slow Rendering Procedures . glDrawArrays

Hello i would like to present my problem here. At the moment i have a scene with about 250 trees , 100 ferns , a player model and a custom generated terrain (from height map). For the past few days i ...
0
votes
0answers
33 views

How to use a sprite class in cocos2d-x? [closed]

I am writing a game and would like to add child from a different class (Actor.cpp). I try two method to implement the sprite, but neither can show the sprite on the simulator. Do I implement it wrong? ...
2
votes
1answer
88 views

Character states in component based entity system

I'm working on a Zelda-like game (github), and I made a component-based entity system. I've a Scene class which holds a std::vector of SceneObject. SceneObject is a collection of components Scene ...
2
votes
1answer
43 views

Since D3DX utility library is deprecated, what can I do about this legacy code?

D3DX Structures utility library is deprecated for Windows 8 and its not supported for Windows Store apps. So my question is, Does anyone know what to replace this legacy code with.. ...
5
votes
2answers
190 views

Should a game clean up after itself when exiting? [closed]

Should a game/engine clean up after itself(close windows, shut down renderers, close files, free memory) when its closed? The OS should do that anyway, and usually in a faster way. I guess most ...
0
votes
0answers
46 views

SDL2 - Windowed mode, VSYNC active, refresh rate 56hz instead of 60hz

As the topic title says. System is Windows 7 64bit. C++. I am not sure why this happens. The refresh rate in the window is 56 hz (calculated in the application from SDL_GetTicks) instead of the ...
1
vote
1answer
86 views

Stepping through 3D noise to generate a cubemap for a sphere

This is somewhat related to a previous question I asked How to create a seamless cubemap noise texture? I have managed to successfully step through a 3D noise function to create a cubemap texture ...
0
votes
1answer
71 views

Is it better to make a cpp and hpp file for every new object or is it better to make one parent class and define types in there? [closed]

Let's say we make a game. The game has items, enemies, allies, etc and there are multiple of them, like zombies and robots as enemies. Do you think it would be better to make one parent class called ...
0
votes
1answer
42 views

SFML drawing Tiles low fps

int main() { sf::RenderWindow window(sf::VideoMode(800, 800), "SFML works!"); sf::VertexArray Tquad(sf::Quads, 40*40*4); int size{ 20 }; int width{ 40 }; for (int x = 0; x < width; x++) { for ...
0
votes
0answers
23 views

Directx 9 Obj Model

There's is a error with my obj load/render that I can't solve I'm a newbie in directx 9, I'm trying to do this in the best way The model is not displayed properly, do not know if this correct model ...
0
votes
1answer
48 views

2d Collision detection response equation doesn't work

I am currently doing some game engine programming as a hobby. I have been working on getting the collision detection working for a while now, and I'm at my wits end with it. I started with this ...
0
votes
1answer
30 views

Why is each column being shifted down the X value of the column in my 2D Data Structure?

I have a two 2-dimensional arrays. One of which stores characters from a text file, and the other stores pointers to instances of Blocks. For some reason, in either of the arrays (I'm not sure which), ...
0
votes
0answers
58 views

server/client architecture, how to combine physics data, scene graph and database over the network?

I'm writting a C++ server and a C++ client for a rpg game. The client is using OpenSceneGraph for rendering the 3D. RakNet is used for communication between the client and server. At this time, the ...