I'm attempting to build a library of custom elements that are deveride from various standard elements. For example, I created a rollOverImage element from an img element. It all works great until it gets to event handling. There doesn't seem to be an easy way to assign an event to a method with...
I have a class. This class is to call upon a function that i specify. How do I make callback function pointer reference thingy? So I can 'set' what function the class calls. Btw this function is defined outside of the class and is not part of the class. Thank you.
I just got a new HD for an old Persario 1235 notebook. I installed it and it is recognized fine, however it only shows its is 8455MB large, when in reality it's 30,000. I looked online a little but couldn't find a BIOS update for this notebook. Is there a way to make the 30 work in this laptop...
Hi, I'm a desktop vetran, but a laptop noob. So my grandma got some new HP laptop and gave me her old persario. It's not too bad, AMD K6-2 266, 32mb ram. I've decided it wouldn't be that hard or expensive to upgrade to at least a level that I can load win XP onto it. So, I have 3 questions for...
I'm having problems with my 2d rotation script. Basically, it is supposed to rotate a list of objects around a central point (refered to by "this"). Here's the script, but it doesn't work properly, the points do not rotate about the center, they just sorta randomly fly around and distort in a...
I'm working on a game engine in director and i notice that while it runs, it keeps using more and more memory. This happens in director and when it's a standalone projector. I've been throught my code serveral times, and nothing shood dynamically take up more memory. Even when the functions that...
How do i get cin to read all the words i type. Here's the code so far, this doesnt work right:
std::string input;
bool bQuit;
bool r;
void main(){
bQuit = 0;
r = console.openLogFile();
console.logMessage("Engine startup");
while (bQuit == 0){
std::cin>>std::noskipws;
std::cin>>input...
My visual c++ 6.0 is getting stuck after a build. It compiles everything (and returns error messages when I'm bad), but then it will not let me exit or build again. It says "you cannnot exit with a build in progress. Choose the command 'stop build'". However, no matter how many times i click...
How do I write a " into a file? Obviously the compiler doesn't like:
fs<<";
Is there a thing like \n that stands for a ". I thought i remember seeing it somewhere. If not maybe a decimal to ascii conversion function?
Thanx.
Ok, my engine developement has finally reached the stage of mass game object programming. All the objects in the game are deveried from the class 'cls_object', which looks like this:
class cls_object{
public:
id id;
std::string alias;
cls_renderer* pRenderer;
public:
cls_object()...
Ok, my engine is coming along nicely. All the pieces are nearing completion and I'm approaching the part where they all need to talk to eachother. I have my engine set up in many different classes:
engine--
--renderer
--world
--console
Each class is declared in its own c++ file and they...
I have a vector of char arrays declared as such:
vector <char*> aliasList;
I add stuff to it like this (alias is a const char* passed to the add function):
aliasList.push_back(new char[strlen(alias)]);
strcpy(aliasList.back(), alias);
So being that I dynamically added it, i assume i...
I'm trying to read a file a line at a time and store it in a string using the getline() function. This is the troubled section:
int cls_console::execScriptFile(const char* fileName){
int r;
string lin;
string strmsg;
string strfil;
ifstream scr(fileName);
strmsg =...
These vectors are kicking my butt! 'layer1' is defined as such:
vector <cls_sprite*> layer1;
I'm adding sprites to it with my addSprite method:
cls_sprite* cls_spriteCollection::addSprite(int layer){
if (layer == 1){
layer1.push_back(new cls_sprite());
layer1[layer1.size() - 1]->id =...
How can i delete an element from a vector that lies in the middle of the vector? Like lets say i have a vector with 5 elements and i want to remove element 3. I assume you have to use iterators, but I can't find any documentation on how to simply delete a random element. Thank you.
Hokay. So I have a vector of pointer to my class. We'll call it myClass. So the code is
vector <myClass> collection;
collection.push_back(new myClass);
So all that seems to work fine. Now, I need to set up some of the class instances properties. This is where i run into trouble...
If i include <string> and do the 'using namespace std' thing, to declare a string can i simply do this?
string myString;
int main(){
myString = "Duck";
myString = "Goose";
}
Does that code look leagal? Also, is there a way to retrieve one char of a string? I dont know if...
Me and a couple of guys are writing a game. The only thing code-wise stopping us is our lack of a dynamic mutt array. What i mean by this, is an array that has no fixed length and can have elements added and removed from it. It also needs to be able to accept a bunch of different types. Like...
Is there a way in VB to define an array that has no "range". That is, you can keep adding stuff to it until the client machine runs out of memory. I think the term used to describe such an array is "zero defined" I'm making a money management program like "Microsoft...
How would I load several bitmaps from file and store them in an array? What type of array would it be? I need to be able to bitblt them onto my form as i need to. I tried using an stdPicture array, but bitblt won't copy them.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.