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

learn more… | top users | synonyms

0
votes
0answers
4 views

Zooming In SDL 2.0

I'm currently working on a project in which I render pictures raw. That is I use simple IMG_LoadTexture(), SDL_RenderCopy(). I want the program to be able to zoom in/out and textures to be scaled to ...
0
votes
0answers
12 views

crash while debug shader

I build a very basic directx 11 game that render simple cube with vertex and index buffer. I am run my game in graphic diagnostic and capture some frames. The problem is when I open the frame in ...
-1
votes
0answers
25 views

How to read a file in c++? [on hold]

I wanted to know how i could read a file called box.3d in a file on my desktop called objects in c++. I've looked and couldn't find anything that work for me. Also how could I make a function where ...
0
votes
1answer
19 views

Implementing a modal dialog from scratch with C++

Right now I'm implementing my modal dialogs in windows with a separate message loop after popping up the dialog. This straightforward an approach won't work with other systems that don't have message ...
0
votes
0answers
44 views

Octree Frustrum Culling

times came when i had to implement some culling into my engine. I started by reading some stuff and so far so good. I managed to create an octree which can effectivly divide my geometry's vertices ...
0
votes
1answer
46 views

Why would this scaling matrix have no effect?

To draw a simple model using the DirectXTk, I'm doing the following. It all works perfectly, draws correct, and so on. Except changing the scaling factor makes NO difference, and I can't figure out ...
-4
votes
0answers
21 views

Rearranging std::multiset Container [on hold]

In my program when I make a change, I want to reorder my set but when I call these two alternative functions I get an iterator not incrementable error. I realised that the problem occurs when I call ...
0
votes
1answer
29 views

Problem with ID3D11DeviceContext::CopyResource method - How to properly read a texture CPU-side?

I am trying to make a full copy from a render target texture to a staging one but it seems my data length ends up being only 4 in length instead of 921600 (1280 * 720). Here is my textures ...
3
votes
4answers
96 views

Special Pathfinding Algorithm

I need help with following pathfinding Task: I have a grid (7x7 squares) and the starting square is always on the far left side (column 0) and its target is to reach the far right side (column 6). ...
0
votes
0answers
32 views

Adding a 3d model to c++?

I've made a 3d square in sketchup and I wanted to know how to implement this object into c++? Do i have to install additional programs or can i do it with just dev-c++ and the square? The square is ...
0
votes
2answers
62 views

c++ graphics and pixels help?

Is there a way to change the color of a specific pixel in C++? I've made an example project where I used graphics.h's bar to change every pixel on the screen: #include <graphics.h> int main( ) ...
5
votes
2answers
359 views

Multithreaded Game Loop

I'm trying to implement a multithreaded game loop. I already did that but had to use a few locks for that, which ruined the performance. After researching a bit I came up with this idea: Instead of ...
0
votes
1answer
28 views

traversing the area

i want to move point along spiral like hexagon for example i want to traverse the whole area and my player (point) is standing where i have placed it manually. now i want to start from this point and ...
0
votes
1answer
41 views

Beginning on animations

I am clueless with regards to animations. I have a simple rendering engine that renders models, sprites, skyboxes and whatnot; but everything is simply static with no animations whatsoever. With my ...
2
votes
1answer
93 views

Smooth Wall Collision Detection

I've been working on a small game, and I've been stuck on the collision part. During the collision, when my player hits a block, he stops just as it should, but it then doesn't allow me to another ...
1
vote
1answer
30 views

How to correctly specify the offset in a call to glVertexAttribPointer()?

I'm trying to draw a simple triangle using the following vertices: std::vector<VertexFormat> vertices; vertices.push_back(VertexFormat(glm::vec3(0.25, -0.25, 0.0), glm::vec4(1, 0, 0, 1))); ...
1
vote
0answers
15 views

Inverse kinematic joint limits

I want to limit the joint angle of my character. I have just one issue i can't get the value of the joint limits of the human -i search about max, min angle of each joint in x and y but i can't get ...
0
votes
0answers
14 views

Platformer Tile Map Collision Help

I've been working on a small platformer as a simple project but, I'm having troubles with my collision detection. What I want is that as the player falls due to gravity, it will stop when it touches ...
0
votes
1answer
29 views

Generic multiple containers derived classes for Entity System

I am working on an entity system for a game. I have read that cache is very important with the common operation of iterating over entities and their components. Currently I have a class World that ...
0
votes
0answers
20 views

How do I hide the navigation bar in Android using the NDK? C++

I can't seem to enable immersive mode in android using the NDK. The only code that I've found relating is AConfiguration *config = NULL //AConfiguration_new(); ...
1
vote
1answer
51 views

How do you know when you are ready for game programming? [closed]

I've been programming for a while now and I want to make games or game engines. But I don't really know how much of programming one does need to learn to have the proper knowledge to make games. My ...
1
vote
0answers
16 views

Is it possible to have a SoA Vertex Buffer in DirectX 11?

Hi! I'm wondering if it is possible to structure a Vertex Buffer in a SoA approach like this { x1, x2, x3 . . . xn, y1, y2, y3 . . . yn, z1, z2, z3 . . . zn } instead of the traditional AoS ...
-4
votes
0answers
46 views

Help with a game mechanic! [closed]

I need help with a game mechanic. How would I do this; when the player starts clicking/tapping, time starts to pass , when he stops tapping its game over.
0
votes
0answers
24 views

Terrain Generation Lag [closed]

I've been messing around with a little terrain generation program I made, and I'm having trouble getting the program to run faster. I, so far, have no clue how to make the game run fast. Every time I ...
0
votes
0answers
36 views

Pass by Reference Issues [closed]

Currently in my game code the Player class handles projectiles and I am altering it so that the Game class does this instead, I want there to be a dynamic array (vector) of projectiles that will be ...
1
vote
2answers
63 views

Making Save and Load Windows using SDL

I've been working on a world builder project recently and I've finished most of the work but there is just one thing I can't think of how to do. For example in a strategy game's world builder when ...
6
votes
0answers
274 views

Strange SSAO effect (wrong position/normal textures in view space?)

I try to create an SSAO effect in my game engine (DirectX 11, C++), based mainly on gamedev.net tutorial by José María Méndez. Unfortunately, it doesn't cover texture-creating problem (normals, ...
0
votes
1answer
31 views

Can't draw lines in 2D space with GLFW and OpenGL

I'm trying to draw a grid in 2D space using GLFW and OpenGL but for some reason I only get this on the screen: Here's my code: #include <GLFW/glfw3.h> #include <stdlib.h> #include ...
0
votes
1answer
82 views

How to pass a big (60+) amount of variables to an HLSL pixel shader?

I am in trouble at trying to pass a big amount of variables needed for my pixel shader computations. After trying and failing to link my struct to a cbuffer (data alignement mismatch) I tried passing ...
0
votes
0answers
24 views

RakNet & Allegro Client/Server Program Lagging?

I have a simple RakNet program that I wrote up with Allegro, and when I run the program and connect the Clients to the Server, they program starts to lag and uses up practically all of my CPU. I ...
1
vote
3answers
88 views

GLSL shaders work when hardcoded, not when loaded from file

I am trying to learn OpenGL. I have a main.cpp where I create the vertex and fragment shaders as strings, compile and link and it works fine. When I try to load the identical shaders from text files, ...
0
votes
0answers
27 views

Having trouble running OpenGL on MSVC

I'm using the OpenGL Programming Guide, 8th Edition with MSVC 2013 but I can't get the triangles.cpp file to run. These are the errors popping up: http://puu.sh/jAokn/c07420cf46.png
1
vote
1answer
94 views

Setting up an efficient OpenGL rendering loop

This is the code that I use to setup my shader char* vertexShaderSource = getResource("vert.shad"); char* fragmentShaderSource = getResource("frag.shad"); vshad = readFile(vertexShaderSource); fshad ...
3
votes
2answers
409 views

Mapping a C++ struct to an HLSL cbuffer

Out of curiosity (and peace of the mind...) I wondered how DirectX decides which attribute from a struct corresponds to the right variable inside an HLSL cbuffer-register(x) (apart from the order/type ...
1
vote
0answers
67 views

Creating random nebulae for scrolling space background

If you've ever seen a picture of space, you'll most likely see that there is some kind of pretty nebula in the background. I would like to find out how I could create random, semi-realistic looking ...
0
votes
2answers
80 views

Clean way to do sprite flashing?

In old, 8-bit/16-bit games, sprites flashing every other frame were common. I don't want to use the hacks I've used before. Is there an elegant/clean way to do this? This is how I usually do it: bool ...
0
votes
0answers
59 views

Creating A Selectable Object in SDL/C++

I'm trying to create a clickable object. I wrote a pseudo code to try it. When I add a new member to object it works fine, that is when I hold the mouse cursor on the rectangle determined it returns ...
0
votes
0answers
21 views

Unreal Engine 4 Line Trace Error

This is the error that I am currently facing: PlayerPawn.cpp.obj : error LNK2019: unresolved external symbol "public: bool __cdecl APlayerPawn::Trace(struct FHitResult,class AActor *,struct FVector ...
0
votes
1answer
66 views

How do I dynamically grow a voxel world in all directions with chunks?

I've organized a Voxel world already but the problem is that it can only "grow" outwards. As a result, there is a single corner where it grows from, then outwards from there on. I want to be able to ...
1
vote
3answers
167 views

2D Rendering Based On Y Coordinates

I'm trying to build an RPG worldbuilder. I have seperate classes for images. Like this. Object1::Object1(int x, int y, CSDL_Setup *sdl_set, int *p_CamX, int *p_CamY) { X_pos = x; Y_pos = y; ...
0
votes
1answer
50 views

EXE-ifying custom levels/scripts/graphics/music

My game is pretty much just a game-builder, where you create your own levels, scripts, graphics, music etc. and the game just loads them from a file you tell it. But how would I make it so the user ...
1
vote
1answer
31 views

How to correctly pass multiple light structures to shader stage?

I'm having some problems when passing multiple light structures to a shader stage. I'm using an array of point lights that is updated each frame. This is my code for creating the buffer ...
0
votes
1answer
22 views

Polar movement towards cursor sfml and c++

I got smooth movement down moving based on the window but I wanted to see if I could move my sprite to my cursor when I pressed w instead of just in the -y direction but everything went wrong right ...
-1
votes
1answer
27 views

Cannot link SFML to my project in code::blocks [closed]

If anybody uses SFML, could you tell me how to add it to a project in code::blocks? Any technique will do.
0
votes
1answer
46 views

Animating a Sprite After Mouse Release - SFML

I'm working on a game where the user can drag and release sprites. After the sprite is released it should interpolate (animate) back to its original position. So I researched on the math relevant to ...
1
vote
0answers
49 views

How do you fix wobbling shadow edges?

I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really ...
2
votes
0answers
31 views

How do I sample a cubic shadow map in DirectX 11?

I've implemented a cubic shadow map for dealing with omni-directional light sources in my scene. By defualt it produces hard shadows Obviously a shadow map with higher resolution (currently using ...
3
votes
1answer
68 views

Porting a SFML game to the browser? [closed]

I've been messing around with SFML, it's my first experience with C++ and I'm enjoying it. But I'm wondering how to publish my game onto anything other than a native platform. Noting that this is my ...
0
votes
0answers
22 views

OpenGL Quad Tessellation - What kind of VBO?

I'm just getting into tessellation and after drawing and tessellating a triangle, I want to try a quad. If I change the TCS to output 4 vertices, the TES to expect a quad and the patch size to 4, only ...
0
votes
0answers
18 views

Making a UDK server - with custom loadouts

Basically I need some help with creating a UDK server on my custom map. I have a Custom Main Menu that has four different weapons to choose from. Once you click on the weapon of choice i want to be ...