C++ on Stack Overflow and Game Dev
C++ on Stack Overflow and Game Dev
I have this function prototype code for factorial calculation by iteration
How do I include a timer to produce total time spent for looping 100 times of the function?
for (unsigned long i=number; …
I am trying to blend 2 images so that the seams between them disappear.
if blending NOT applied:
if blending applied:
I used ALPHA BLENDING; NO seam removed; in fact ...
I'm having trouble trying to execute keyboard events in a another class with GLFW3. The problem I'm having is that GLFW3 uses a static function for input as shown:
static UI u;
static void …
The following is my struct:
int operation; //-1 initial. 0 if shift, 1 if reduce.
I have the following method header:
bool ParseMessage(char* buffer, int &fromNode, map<int, string> &messages, const int MAX_CHARS_PER_LINE = 512, const int MAX_TOKENS_PER_LINE = 20, …
I am trying to build wxHaskell for wxWidgets 3.0. I used the latest git version of wxHaskell from https://github.com/wxHaskell/wxHaskell.
I tried to follow install.txt in wxHaskell-master.zip, what I …
I am trying to implement code for an assignment to render skeleton and mesh animations. In my glBegin(GL_TRIANGLES) section, I have some vectors that appear to be interfering with my information when …
First timer here, so I may need a bit of handholding.
I've been trying to just used the simple libcurl examples but am tripping up when compiling.
I'm trying to use NuGet and followed what I read in …
I have created a small program where it uses static void function to get the number and another static void function to display the number. But when ever the application runs, it gives me this error
In C, I think there is no reference, so the return value could be a pointer or the datatype itself. If it's a local variable, return a pointer doesn't make any sense. If the variable is dynamically …
cin >> num;
Is it well defined how many characters of the input this code can consume. I am particularly interested in the case where the input stream may have the num ...
I'm going out of my mind here. I expect to catch exceptions in C++ so that I can map them to a custom exception class in python. All I get now are python Exceptions. I cannot catch my Exceptions …
Say I have a list<TreeNode> in my program. Every time I use new to dynamically allocate a TreeNode class and attach it to the list; when the program is over, the list is gone. However, I am not …
Hi I would like to know if it is possible to simply take a screenshot with SDL2.
I tried SDL_GetWindowSurface but I get an error saying: "No hardware accelerated renderers available." I took the code …
I use a simple string function "strstr" to find the first occurrence of a sting in a text. I use the following code to count the number of unique words in a text.
I have been trying to implement the algorithm for the median filter presented in the Wiki article: http://en.wikipedia.org/wiki/Median_filter#2D_median_filter_pseudo_code
To the best of my knowledge, …
I am writing a physics program in C++ to approximate the range of an object using several algorithms. I have declared a base class Simulation which contains both concrete and abstract methods. (e.g. …
guys. I have an assignment due for my intro c++ class next week and I need some advice for how to go about doing it. I have to make a word count program that gives out the number of lines, words, ...
I'm building an io framework for a custom file format for windows only. The files are anywhere between 100MB and 100GB. The reads/writes come in sequences of few hundred KB to a couple MB in ...
I am trying to get SSL/TLS connections to work in windows. Right now I am using Schannel, but I am not sure this is the correct way to go about it. Here is my code. An exception is thrown at the ...
I'm using qt dbus binding in c++.
Currently I'm able to send any custom types (e.g.: class, structs) over dbus but I am not able to send an enumeration.
I also tried this link here, but I do not get …
I was trying to get the execution time of a particular piece of code (may be a loop or a function, etc.). I heard that command time or function clock() do the job. But my requirement was accuracy in …
I have a video that I need to partition into small clips of size N, N being somewhere between 3 and 10 frames. Is there a function or method that will grab the next N frames and return them in a ...
void setTitle(string Title);
void setDirector(string Director);
Is it possible to unlock the mouse in fullscreen mode so that you can use it on a another monitor?
I read trough the SDL documentation, but I couldn't find anything related to my problem.
I need to fill an integer-type variable (of arbitrary size) with data from /dev/urandom. With that in mind, I have the following piece of code:
std::fstream fstr("/dev/urandom", std::fstream::in | …
I have one solution with 2 projects in it. (VS2013)
One project is a Direct3D with XAML project, the other is a Static class library.
I have set up project dependencies.
I am wondering if the ...
When compiling the project I get the following error:
drawplant.h: In function 'Matrix3f current_matrix()':
drawplant.h:26:1: error: only constructors take member initializers
I'm using a console in my multithreaded application. Right now, it only accepts output (printf and the like) and so far I have no issues. However, I want to be able to support console input as well, …
I seem to be having issues with the following segment and the latest exception I'm getting is:
Unhandled exception at 0x01321A01 in LinkedList.exe: 0xC0000005: Access violation writing location ...