I'm pretty confused about lists. They work as I would expect except for removing elements.
The erase() method wants an iterator. But if I remove one element, the position of all the others after...
Type: Posts; User: JMK
I'm pretty confused about lists. They work as I would expect except for removing elements.
The erase() method wants an iterator. But if I remove one element, the position of all the others after...
I am looking for a programmer to develop a program which can take screenshots and record video from any game on Windows 7, Vista, and XP. MacOS support would be nice, but it's not required. The...
It was caused by my misunderstanding of the std::map protocols. I did not realize it was written in the worst most inconvenient way possible.
The debugger lists the pair "materialcolor" (the name string) and 0x00000, even though the local uniform variable is not NULL. It looks as though I did this:
uniforms.insert(std::...
map.insert fails every time. If I create a temporary map in the function it works fine.
class OpenGLShaderReference : public ShaderReference
{
public:
map<std::string,OpenGLUniform*>...
Oh god. :|
Thanks.
No. MSVC also says:
CLS_COLOR is a constant.
#define CLS_COLOR 1;
Why does this code produce errors?:
if (CLS_COLOR & clsmode)
{
clsflags += GL_COLOR_BUFFER_BIT;
}
I want to copy a float value to an allocated block of memory, with an offset from the memory block pointer.
void Bank::PokeFloat(const int& pos, const float& n)
{
if (pos<0) return;
if...
I opened BUild Options, and in Link Libraries I just added this line:
libgdi32.a
And it worked!
I don't know what that means.
I get this error:
On this line:
wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH );
I am using Code::Blocks with the GCC compiler.
I did create a window using CreateWindowA. I need to include GDI for it to work. It gets automatically included in a Window program, but not a console program, so I need to know what to include.
How do I include GDI into a console program? None of these work:
#include <gdi.h>
#include <gdi32.h>
When I run make.exe, it says this:
C:\Project>make
cc myprog.o -o myprog
process_begin: CreateProcess(NULL, cc myprog.o -o myprog, ...) failed.
make (e=2): The system cannot find the file...
I am trying to set up a makefile for use with GNU make for the first time:
My program has the following files:
myprog.cpp
myprog.h
Then I want to make an object file and include it from these...
Adding this in the class declaration:
std::vector<Entity&> kids;
Causes this error:
How do I declare that as a member of a class and initialize it with 0 length?:
class Entity {
public:
std::vector<Entity&> kids;
};
Does C++ have some kind of resizeable array that can contain references? I need to store references and be able to iterate through them as fast as possible. It may have any number of objects stored...
Thanks. I am learning a lot really fast!
The Entity class looks like this:
class Entity {
public:
bool hidestate;
Entity* parent;
};
bool Entity::IsHidden()
Yep:
if (src!=NULL)
{
srcmat = &src->mat;
}
I ended up making a few overloaded functions so that both references and pointers can be used. References would be adequate if they could be set...
Thanks, it seems to be working.
Looks like now it needs to convert the mat reference to a pointer?:
Vec3 TFormPoint(const Vec3& point, Entity* src, Entity* dst)
{
Mat4* srcmat;
Mat4* dstmat;
if (src!=0) {
srcmat =...
I am trying to write use pointers for some function arguments. The reason I am using pointers and not references is that either the src or dst arguments might be NULL.
Vec3 TFormPoint(const Vec3&...