380 Posted Topics

Member Avatar for Labdabeta
Member Avatar for JamesCherrill
0
362
Member Avatar for Labdabeta
Member Avatar for Labdabeta
0
413
Member Avatar for Labdabeta

Is it possible to define a union at creation. ie: [CODE]union Colour { unsigned int i; char c[4]; struct{ char a; char r; char g; char b; }col; }Black(0xFF000000),White(0xFFFFFFFF),Red(0xFFFF0000),Green(0xFF00FF00),Blue(0xFF0000FF)/*etc...*/;[/CODE]

Member Avatar for Labdabeta
0
130
Member Avatar for Zssffssz

Not sure I fully understand, but for windows based DOS console style you can take a look at [URL="http://www.adrianxw.dk/SoftwareSite/index.html"]Win32 Console Applications[/URL].

Member Avatar for Zssffssz
0
222
Member Avatar for Labdabeta

I am VERY confused by the Doxygen configuration file. I cant seem to figure out how to make it compile code between [ICODE]#ifdef __cplusplus[/ICODE] and [ICODE]#endif[/ICODE] Also I dont understand how to change what it does with preprocessor symbols or how to make it NOT generate documentation on something. Any …

Member Avatar for mike_2000_17
0
163
Member Avatar for Labdabeta
Member Avatar for rubberman
0
142
Member Avatar for Labdabeta

Is it possible to put a gap in a class definition? IE: [CODE]class a; class b { private: a test; public: a getA(){return test;} }; class a { private: int i; public: a(int i):i(i){} a operator+(int o)const{return a(i+o);} }; class b continued?//what? how? { void outputA(){cout<<a;} };[/CODE] This is just …

Member Avatar for Labdabeta
0
184
Member Avatar for Labdabeta

What does it mean if my opengl objects are opaque from one side and translucent from another?

Member Avatar for Labdabeta
0
88
Member Avatar for Labdabeta

here is the question, what does str(X) become [CODE]#define str_(X) #X #define str(X) str_(X)[/CODE] when X is a string? is it ""string"" or "\"string\""?

Member Avatar for Labdabeta
0
113
Member Avatar for alexander1s

It sounds like you are trying to use basic file io. There are two main ways to do this, one is using standard io (stdio.h) and one is using file streams (fstream.h) you can google and learn about both of these methods.

Member Avatar for James19142
0
130
Member Avatar for Labdabeta

I am extremely confused about libraries and have been having trouble understanding them with google. Basically I want to create a library so that I can use a bunch of functions from another file without all of the libraries' contents being seen. EG: library code: [CODE]class test { private: int …

Member Avatar for Labdabeta
0
217
Member Avatar for Labdabeta

Is there a way to make a class visible only from within another class. i.e: [CODE]class myclass { private: class anotherclass { //stuff that only can be used from within a myclass function void dosomething(); float dosomethingelse(); }*anotherclasses; int numanotherclasses; public: int createanotherclass();//creates anotherclass object, puts it in the array …

Member Avatar for mike_2000_17
0
234
Member Avatar for Labdabeta

I am trying to make a static library using Code::Blocks and when I make a new static library project it generates a cpp file with functions encased with [ICODE]extern "C"[/ICODE] I am just wondering if this is necessary or if I can write the functions in normal c++ as well.

Member Avatar for vijayan121
0
133
Member Avatar for Labdabeta

I have this problem: [CODE]struct Position { float x; float y; float z; }; bool CheckCollision(Position *vertices, int numvertices, Position start, Position end) { //return true if there was NOT a collision with the polygon defined by the vertices and the vector defined by the two positions. }[/CODE] I dont …

Member Avatar for Labdabeta
0
215
Member Avatar for Labdabeta

I would just like to know how x86 ASM instructions are translated into binary. EG: [ICODE]mov al,061h[/ICODE] becomes [ICODE]10110000 01100001[/ICODE]

Member Avatar for miker00lz
0
1K
Member Avatar for Labdabeta

I am still having major trouble with my openGL model program. The big issue is that I cannot figure out how to debug it since I am saving the important data to the graphics chip using vertex buffer objects (VBOs) so at least as far as I can tell, I …

Member Avatar for raptr_dflo
0
485
Member Avatar for Labdabeta

Is it possible to use [URL="http://msdn.microsoft.com/en-us/library/45yd4tzz%28v=VS.80%29.aspx"]__asm blocks[/URL] with Code::Blocks IDE? And if so how??

Member Avatar for mike_2000_17
0
238
Member Avatar for Labdabeta

If I make my own math header with similar functions as math.h, can I possibly make it as fast as the implementations of math.h, or does math.h use special hardware or something?

Member Avatar for BCBTP
0
127
Member Avatar for Labdabeta

How do I do 2D opengl? I need to be able to put stuff up on the screen so that it is not rendered in three dimensions, and I need the 3d stuff to still be 3d behind it.

Member Avatar for Labdabeta
0
152
Member Avatar for fsefsef23

I am not entirely I understand the question either, but my guess is that your task is to write a function that can determine the length of stack a without actually using it. I think that you could make a copy of stack a as elements are added to it …

Member Avatar for mike_2000_17
0
223
Member Avatar for Labdabeta

Quick question (though I still want to get my long OpenGL question fixed) is there a faster way to Xor the bits of an integer than this: [CODE](MyInt&0x1)^((MyInt&0x2)>>1)^((MyInt&0x4)>>2)//etcetera[/CODE] Just to clarify by faster I mean faster to execute, not to type as this operation will have to be done many …

Member Avatar for murnesty
0
99
Member Avatar for meli123

If what you want to do is use a loop to test the chars rather than a bunch of if statements then you will have to use an array.

Member Avatar for murnesty
0
211
Member Avatar for Grovega

On line 24 your limiting break statement may be met soon enough so vec[i] becomes longer than vec itself so the error is saying that the subscript ([] is actually called the subscript operator) is too high. Also you dont have to use the break statement, it would be cleaner …

Member Avatar for Labdabeta
0
228
Member Avatar for Labdabeta

Really quick question (I hope) before I buy Maya I want to know if it has the option of exporting coordinates for triangle vertexes rather than images. If it doesn't, is there software that would allow for modeling while exporting vertexes for 3d triangles?

Member Avatar for jwenting
0
156
Member Avatar for Labdabeta

I am still unable to get OpenGL Vertex Buffer Objects to work. I will just show you the code I have written so far: 3dglgui.h (I think this should be fine): [CODE]#ifndef CLASS_NAME #define CLASS_NAME "OpenGL Windows Class"//This can be overwritten to specify a unique class name #endif //Header Guards …

Member Avatar for raptr_dflo
0
159
Member Avatar for Labdabeta

I know that this [ICODE]#define QUOTE(X) #X[/ICODE] turns X into a c-string version of whatever is passed to it. my question is if there is a way to do this in reverse ie: [ICODE]#define DEQUOTEANDCALLFUNCTIONORCLASSWITHGIVENNAME(X) (X#)()[/ICODE] is this possible?

Member Avatar for mike_2000_17
1
181
Member Avatar for Labdabeta

Hello, I have been attempting to create a fast class for OpenGL's Vertex Buffer Objects. I finally got all the libraries to work and now i am getting a sigseg but cant see why. Can someone find my error? (I will keep looking too) [CODE]#ifndef GLMODELS_H #define GLMODELS_H #ifndef GOODGL …

Member Avatar for mike_2000_17
0
140
Member Avatar for Labdabeta

I have been away from internet connection for awhile. Anyways, I am still having library issues using VBOs. Now the only warning that I am getting is [ICODE]undefined reference to 'XXX@Y'[/ICODE] Where XXX is either CreateFont, SelectObject, ChoosePixelFormat, SetPixelFormat, GetObject, DeleteObject, or SwapBuffers and Y is a line number. What …

Member Avatar for Labdabeta
0
153
Member Avatar for Labdabeta

I am looking to make a 3D game, I have made plenty of fun ones in 2D using SDL but have yet to attempt a 3D (fps style) game. Does anybody know either a way to do 3D with SDL, or some other similar or easy to use library that …

Member Avatar for dvidunis
0
249
Member Avatar for Labdabeta

I just observed an unusual phenomena in my code. I am wondering if anyone can explain it. [CODE]void dofunc(int a, int b){a+=b;} void foo(int near,int far){dofunc(near,far);}//Syntax error, expected primary expression before , and ) void poo(int vnear,int vfar){dofunc(vnear,vfar);}//Compiles fine?[/CODE]

Member Avatar for Salem
0
171
Member Avatar for Labdabeta

I have reinstalled my compiler successfully (finally) and got right back to work. I have created a glModel class as follows: [CODE]class glModel { private: int numv; int numn; unsigned int model; unsigned int textu; unsigned int norma; float *vars; float *norm; public: glModel():numv(0),numn(0){vex=new float[1];tex=new float[1];nex=new float[1];} glModel& Vertex(float tx, …

Member Avatar for Labdabeta
0
156
Member Avatar for Labdabeta

I am making a program and I want to be able to determine the refresh rate of the monitor somehow (to limit an fps cap). I am using windows API. Is there anyway to access this?

Member Avatar for Labdabeta
0
961
Member Avatar for Labdabeta

Just wondering which of these functions would be faster (or if they would be the same): [CODE]class MyClass { private: bool MyVar; public: MyClass &Function1(bool MyVar); MyClass &Function2(bool MyVar); MyClass &Function3(bool var); }; MyClass &MyClass::Function1(bool MyVar) { this->MyVar=MyVar; cout<<MyVar; return *this; } MyClass &MyClass::Function2(bool MyVar) { this->MyVar=MyVar; cout<<this->MyVar; return *this; …

Member Avatar for Labdabeta
0
105
Member Avatar for Labdabeta

Code::Blocks isn't working. I recently reinstalled to get a newer version and when I hit build I get the following error: [CODE]mingw32-g++.exe -Wall -g -I"C:\Program Files\CodeBlocks\MinGW\include" -c D:\Programming\C++\TESTINGOPENGL\main.cpp -o obj\Debug\main.o Execution of 'mingw32-g++.exe -Wall -g -I"C:\Program Files\CodeBlocks\MinGW\include" -c D:\Programming\C++\TESTINGOPENGL\main.cpp -o obj\Debug\main.o' in 'D:\Programming\C++\TESTINGOPENGL' failed.[/CODE] Please help!

Member Avatar for Labdabeta
0
2K
Member Avatar for Mike_11

You are comparing your integer to X. What is X? In this program it is not set as anything.

Member Avatar for AKMafia001
0
407
Member Avatar for Labdabeta

Is it possible to do any logic with gl lists, I am trying to make a wrapper class for them and I have this code in the compile function: [CODE] glNewList(model1,GL_COMPILE); glBegin(GL_TRIANGLES); int pos=0; for (int i=0; i<numcmds; i++) { if (cmdtype[i]=='v') { glVertex(cmdarg[pos++],cmdarg[pos++],cmdarg[pos++]); } else if (cmdtype[i]=='t') { glTexture(cmdarg[pos++],cmdarg[pos++]); …

Member Avatar for Labdabeta
0
241
Member Avatar for Muhammad Anas

I don't see anything wrong. I would suggest for good practice also setting your pointers to null when you deallocate them. I sometimes like to define delarr in a preprocessor macro: [CODE]#define delarr(X) (delete[](X));((X)=0)[/CODE] Hope this helps. (Also I may be wrong so more people should check as well)

Member Avatar for Muhammad Anas
0
159
Member Avatar for Labdabeta

I need to make a function: [CODE]void GenerateNormal(float x[3], float y[3], float z[3], float &ox, float &oy, float &oz) { //Calculate coordinates for a glNormal and return them ox,oy and oz }[/CODE] I have a sinking feeling that the math will be quite difficult. Can anybody help me?

Member Avatar for Labdabeta
0
126
Member Avatar for Psyho

Ill try to help, but please put CODE tags around your code so I can read it.

Member Avatar for Labdabeta
0
196
Member Avatar for warrior4321

just remove the cin.ignore() it is saying "forget the first thing that the user enters" you don't want that.

Member Avatar for warrior4321
0
131
Member Avatar for Labdabeta

I have been googling around and have found that the TI calculator that I use uses a z80 chip. I was wondering if it is possible to use assembly rather than the default program language of the calculator to write programs for it. Any ideas of how I could find …

Member Avatar for sergent
0
111
Member Avatar for Labdabeta

I am having some major issues with OpenGL textures. I have the following code to load a glTexture (typedef ed as a GLuint): [CODE]glTexture LoadBMP(const char *fname) { HBITMAP hBMP; BITMAP BMP; glTexture texid; glGenTextures(1, &texid); hBMP=(HBITMAP)LoadImage(GetModuleHandle(NULL), fname, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE ); if (!hBMP) return NULL; GetObject(hBMP, …

Member Avatar for mike_2000_17
0
226
Member Avatar for Labdabeta

This is a conversion question that has me stumped. I need to convert an unsigned char to a signed float. Some examples: 0xFF becomes 1.0f 0x00 becomes -1.0f 0x80 becomes ~0.0f The only idea that I could come up with was a massive switch statement. But a switch statement will …

Member Avatar for ddanbe
0
351
Member Avatar for Labdabeta

I have the following working fine from the command line: [CODE] telnet (my email smtp) 25 helo mail from:(my email address) rcpt to:(my email address) DATA SUBJECT:(my subject) (my message) . [/CODE] This is sending me an email. My problem is that I need to emulate all of this from …

Member Avatar for Labdabeta
0
176
Member Avatar for Labdabeta

How can I send an email through C++. I need to make the following: [CODE]bool SendMail(char* from, char* to, char* title, char* msg) { //What now? //Return true on success, false otherwise }[/CODE]

Member Avatar for Labdabeta
0
130
Member Avatar for Labdabeta

Is there any software out there that can help me create 3d models for use with OpenGL drawing of models (i.e: triangles, square and polygons in 3d space). I need to be able to make polygons in 3d and be able to access the values of the vertexes. Does anybody …

Member Avatar for mrnutty
0
110
Member Avatar for Labdabeta

I decided to post this problem in a new thread. I have a simple program in OpenGL and it doesn't work. What happens is that a transparent window forms and when you hit the 'X' it says that the Release of the Device Context and Rendering Context failed. Here is …

Member Avatar for Labdabeta
0
203
Member Avatar for Labdabeta

Can somebody help me, I wish to learn OpenGL and I don't understand how to set it up. I am using a windows XP machine with Code::Blocks 8.2 and MingGW. How do I get OpenGL working?

Member Avatar for Labdabeta
0
470
Member Avatar for Labdabeta

I did not know where to ask this question so I have put it here, feel free to move it if it is in the wrong place. My issue is that I cannot stand any of the usual programming fonts because letters tend to be the same, either '1' and …

Member Avatar for Labdabeta
0
86
Member Avatar for Labdabeta

I have the following trig functions, but I am wondering if there is a faster algorithm that I could implement: [CODE]static const double SINMIN=0.0009999998333333; static const double COSMIN=0.9999995000000417; static const double TANMIN=0.0010000003333334; static const double E=2.718281828459045235360; static const double PI=3.14159265358979323846; static const double MINVAL=0.01; double sin(double ax) { double x=aabs(ax); …

Member Avatar for mrnutty
0
638

The End.