I wish to generate rays from the camera through the viewing plane. In order to do this, I need my camera position ("eye"), the up, right, and towards vectors (where towards is the vector from the camera in the direction of the object that the camera is looking at) and P, the point on the viewing plane. Once I have these, the ray that's g...
Hi guys, I'm using a hash table (source code by Google Inc) to store some method pointers defined as:
typedef Object *(Executor::*expression_delegate_t)( vframe_t *, Node * );
Where obviously "Executor" is the class.
The function prototype to insert some value to the hash table is:
hash_item_t *ht_insert( hash_table_t *ht, ulong ke...
I have a problem. I wrote example code and I want to build it without the error:
main.cpp(.text+0x5): undefined reference to `test()'
Library
test1.c
#include <stdlib.h>
void test()
{
puts("Działa");
}
test1.h
#ifndef TEST1_H
#define TEST1_H
extern void test();
#endif
makefile
all:
gcc -c ./src/test1.c -o ./lib/test1.o
...
I've got a functor f, which takes a function func and a parameter t of the same type as func. I cannot pass g to f because of compilation error (no matching function for call to f(int&, void (&)(int&)) ). If g would take non-reference parameter g(int s), compilation finishes. Or if I manually specify template parameter f<int&>(i, g), com...
Hi, I tried to make the code #1 more terse by changing it to code #2 but it doesn't work as expected. Can anyone please tell me why it doesn't work? Thanks.
Code #1
double x = 8.9, y = 3.4, z = -4.5;
std::ostringstream q0;
q0 << "(" << x << "," << y << "," << z << ")";
std::string s = q0.str();
Code #2
double x = 8.9, y = 3.4, z = ...
Hello, I have been programming in C and C++ for a few years and now I'm just now taking a college course in it and our book had a function like this for an example
int foo(){
int x=0;
int y=20;
return x,y; //y is always returned
}
I have never seen such syntax. In fact, I have never seen the , operator used outside of parameter ...
I'm porting a small academic OS from TriCore to ARM Cortex (Thumb-2 instruction set). For the scheduler to work, I sometimes need to JUMP directly to another function without modifying the stack nor the link register.
On TriCore (or, rather, on tricore-g++), this wrapper template (for any three-argument-function) works:
template< class...
typedef int py_var_t (void *);
it is used as:
py_var_t *somesymbol
...
g++ compiler gives this error: expected `;' before 'it'
template <typename T>
class myList : public std::list<T>
{
public:
void foo ()
{
std::list<T>::iterator it; // compiler error as above mentioned, why ???
}
};
Thanks.
...
Queries I tried: ExpandEnvironmentStrings("%COMMONPROGRAMFILES%"), GetSpecialPath(CSIDL_PROGRAM_FILES_COMMON).
All resolve to (typically) c:\\Program Files (x86)\\Common Files from my 32 bit app. I need to check a file version installed (typically) under c:\\Program Files\\Common Files of a 643 bit application.
...
Hello,
How do I programmatically get the system country tld. In the registry there's a key called sCountry which has the country's name, but in the system language, eg. If the user has the Spanish version sCountry would be Espana, German version would be Deutschland, etc.
...
I have the following two methods that (as you can see) are similar in most of its statements except for one (see below for details)
unsigned int CSWX::getLineParameters(const SURFACE & surface, vector<double> & params)
{
VARIANT varParams;
surface->getPlaneParams(varParams); // this is the line of code that is different
Sa...
I get an incomplete type error when trying to compile my code. I know that it is related to includes, but my project is large and it uses several templates so I can't find which type is actually incomplete. The error message doesn't help either:
Compiling: ../../../addons/ofxTableGestures/src/Graphics/objects/CursorFeedback.cpp
In file ...
I've made a simple OpenCV application with Visual Studio 2008 and I've built it in both release mode and debug mode.It works fine from my computer but when I try to run it from another computer which doesn't have OpenCV installed or has another version of Visual Studio with OpenCV it doesn't work.
How can I make the app work from a comp...
Hello all,
I have the simplest code that I want to separate in three files:
Header file: class and struct declarations. No implementations at all.
Inline functions file: implementation of inline methods in header.
Code file: normal C++ code for more complicated implementations.
When I was about to implement an operator[] method, I c...
Hello,
I'm looking for a possibility to get the color of a pixel with given screen coordinates (x,y) in c++ / Linux? Maybe something similarly like getPixel() in Windows. I spent the whole day to find sth but without any success.
Thanks, Stefan
...
I'm trying to run through an example given for the C++ Xerces XML library implementation. I've copied the code exactly, but I'm having trouble compiling it.
error: expected class-name before '{' token
I've looked around for a solution, and I know that this error can be caused by circular includes or not defining a class before it is ...
I'm porting some C++ code to C#.
Does C# have an equivalent to std::nth_element() or do I need to roll my own?
...
Hello,
I have a buffer in class 'bufferClass' that will generate a signal to tell 'fileClass' that buffer is full and now write data to file? And when 'fileClass' is done writing to file, it will generate a signal to tell 'guiClass' that data can be read from file.
Is this possible? I have been reading http://www.gnu.org/s/libc/manual...
Hey,
I am working an a simple Roguelike game, and using SDL as the display. The Graphics for the game is an image of Codepage 437, with the background being black, and the font white. Instead of using many seperate image files that are already colored, I want to use one image file, and replace the colors when it is being loaded into m...