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

learn more… | top users | synonyms

0
votes
1answer
6 views

making an infinite sine wave generator

I have the basic understanding of sine wave generation but the problem that I am facing is that the value for time, as that gets larger, my sine wave falls apart and starts to look really ugly. I ...
0
votes
0answers
16 views

What is a simple way to pull input from a keyboard and attach it to a std::string?

The question says it all to be honest. I have a game that I am making in Ogre3D, using OIS as the main input library. My issue is that I am attempting to use CEGUI (with tons of errors) all to simply ...
0
votes
0answers
28 views

Minimalistic and fast C++ based game engines with free commercial use? [on hold]

I've come across so many game engines all claiming they're good and I've tested a lot and they all have some flaw like they're slow, they make too many assumptions, they can't be used commerciallym ...
0
votes
1answer
27 views

Handling input in ECS for multiple characters

I've been reading into Entity-Component-Systems, and they seem rather handy. However, I don't quite understand how input should be handled and after googling and looking thru GDSE posts, I've become ...
0
votes
0answers
29 views

My texture is doing weird, either not loaded correctly or not rendered correctly. DirectX11

I'm loading a texture from a file called owl.png. But it renders really weird. Original picture(512 X 512): But it renders like this: It's rendered on a square, that is initialized like this: { ...
0
votes
0answers
60 views

C++/OpenGl/SDL/Cmake Beginner curiosity [on hold]

and this is my first time in this forum. I just want to ask for an advise in here, I just dont know where to start. hopefully you can understand and help me. I want to start with a small game project ...
2
votes
0answers
30 views

Assimp and directX12 universal apps

I started a directX 12 universal app project on visual studios and started coding some stuff to create a physics engine. I was currently working on implmenting Assimp into the engine too load whatever ...
2
votes
1answer
44 views

What causes SDL2 error 0xc00007b when running my game on other people's computers? [on hold]

I made a game using SDL2 and made it available for download. However, I first tried to install and play it on a different computer, to no avail. I made sure to copy all the .dlls and install all the ...
0
votes
1answer
35 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
22 views

crash while debug shader [on hold]

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
36 views

How to read a file in c++? [closed]

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
56 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
54 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
53 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 ...
0
votes
1answer
32 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
107 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
43 views

Adding a 3d model to c++? [closed]

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
70 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( ) ...
6
votes
1answer
426 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
30 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
43 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
98 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
16 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
34 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
21 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
55 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
17 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 ...
1
vote
2answers
69 views

Making Save and Load Windows using SDL [on hold]

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
314 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
36 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
86 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
25 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
93 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
28 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
97 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 ...
4
votes
2answers
421 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
72 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
82 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
61 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
24 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
172 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
28 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
47 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
51 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 ...