« first day (21 days earlier)      last day (38 days later) » 

10:22 AM
but even is its simply
int a=5;
int const *ptr = &a; // this also works, how do we say this should we say... ptr is a pointer to a const int which is a. or ptr is a const pointer and you cannot change value of a using dereferencing ptr
 
Apparently I have to talk here to be able to move things. @BryanEdds could you add me as an owner, so this might work a little better?
1 message moved from bin
 
weird
ya
 
Yup. Speaking made moving available
 
just need an agreement to said rules to get ownership - gist.github.com/bryanedds/5e0ed2ee92cdd89bee20
 
Fine with me. Your room, your rules. They seem sane enough
 
10:50 AM
 
11:00 AM
HI @sehe the link says
const X* p means “p points to an X that is const”:
however int a=5;
int const *ptr = &a; // this also works, although a is not a constant
 
 
4 hours later…
2:51 PM
Hi guys, i need a portable random number generator. I'm creating a multiplayer game and some parts of the level are randomly generated, so what i need is output sequence of generator to be the same across different machines/platforms with given seed. Does anyone have experience in this ?
 
 
1 hour later…
4:06 PM
@user1977867 that's because it's not a problem to implicitly convert a mutable int reference/pointer into a constant one (after all, you can do strictly less with it). The inverse would not be allowed.
In other words: the fact that you can assign one value to another doesn't require/imply that the types are identical. Just that a suitable implicit conversion exists.
 
hello i have a problem trying to print text in opengl using glut the file is located pastebin.com/NSkCg3Fk
 
@Shipiz std::mt19937
 
@Shipiz for c++11 use the <random> header which - among others, defines default_random_engine (see the sample en.cppreference.com/w/cpp/numeric/random)
For c++03 use <boost/random.hpp> with largely the same interface
@EduardoGutierrez Sounds like a good question to start on Stack Overflow - so you can describe the actual problem in some more detail. Don't forget to search for existing answers
@набиячлэвэлиь ~~effort~~ much :)
 
@sehe It's the only true answer
 
@Feeds Ahoy
 
4:10 PM
the relevant code is here
void output(int x, int y, float r, float g, float b, char *string)
{
glColor3f( r, g, b );
glRasterPos2f(x, y);
int len, i;
len = (int)strlen(string);
for (i = 0; i < len; i++) {
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, string[i]);
}
}
 
@набиячлэвэлиь teach to fish
@EduardoGutierrez so. you posted the irrelevant code as a decoy then :)
 
i pass something like:
char Result[6]; // string which will contain the number

sprintf ( Result, "%d", myPacman->getPoints()); // %d makes the result be a decimal integer

char cadena1[30] = "Score : ";

strcat(cadena1,Result);

output(200,200,255.0,255.0,255.0,cadena1);

sprintf ( Result, "%d", myPacman->getLives()); // %d makes the result be a decimal integer

char cadena2[30] = "Lives : ";

strcat(cadena2,Result);

output(50,50,255.0,255.0,255.0,cadena2);
 
@EduardoGutierrez Are you refreshing/swapBuffering?
 
Large code samples don't work in chat. You can link to pastebin or gist or so
 
and it works perfect in the middle of the screen... i cant write in bottom left and i have tried with so diferent numbers both positive and negative
perhaps id have to make something liki:
glColor3f( r, g, b );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//glPushMatrix();
//glOrtho(-WIDTH*0.6,WIDTH*0.6,-HEIGHT*0.6,HEIGHT*0.6, 10, 2000);
glOrtho(-WIDTH,WIDTH,-HEIGHT,HEIGHT, 10, 2000);
glMatrixMode(GL_MODELVIEW);
glRasterPos2f(x, y);
in order to work with pixels but i cant
And this it doesnt work at all.
char cadenaover[30] = "Game Over";

//strcat(cadenaover," ");
output(200,200,255.0,255.0,255.0,cadenaover);
 
4:13 PM
2 mins ago, by sehe
Large code samples don't work in chat. You can link to pastebin or gist or so
 
the first one works fine ( except the problem of positioning) and the last doesnt show anything....
@sehe you got a pastebin before...yesterday they told me its ok to write little code
 
This is not a 101 chat. Several other conversations were also being held - if they all did this you surely wouldn't get any help either. So, try to be a good citizen OR ask to get a personal chat
@EduardoGutierrez Shall I give you a few screenshots? I think I'll need at least 4 to capture the magnitude of this
 
@sehe yesterday they helped me a lot
 
> its ok to write little code
@EduardoGutierrez That's ok, I said nothing against that. I was suggesting the code was too much for inline.
> So, try to be a good citizen OR ask to get a personal chat
 
@sehe sorry if i bother you but in my opinion 15 lines is little code....id use pastebin the next time
 
4:15 PM
The latter is just 2 button clicks for anyone with enough rep to chat AFAIK
 
well is anyone can make a personal chat...
 
@EduardoGutierrez Thank you. I can assure you none of the code samples you posted just now even fit on my screen. And that has nothing to do with my screen (perhaps with my eyesight).
Regardless there is the fact that you might not be the only one having a conversation in a public chat :)
 
any help would be apreciated
 
@EduardoGutierrez You or @набиячлэвэлиь can both do it if you agree :) (I'm fine with it staying here, but you'll have more freedom and less distraction otherwise)
 
4:20 PM
well i have to left....iid be back later...
 
@EduardoGutierrez See you around
 
4:57 PM
@sehe I was really puzzled by this comment until I remembered that I was looking at this chat in a widescreen monitor turned to portrait orientation.
 
5:10 PM
That's quite specific. Interesting you can forget :)
 
 
3 hours later…
7:54 PM
One question i ve this: std::ofstream myfile("example.txt", std::ios::out | std::ios::trunc);
in theory every time i write the file it has to began to write from the begining, but i notice that it appends ( it adds registers at the end of the file)... Im doing something wrong ? thanks...
 
8:36 PM
??
 
9:11 PM
bfff thats weir because i dont know why it keeps adding registers....
 
9:23 PM
@EduardoGutierrez Throw the code in coliru and show us.
 
coliru.stacked-crooked.com/a/cae4b3c8f2853d7f i think i have spot the problem....
but i have an weird problem im using function output to print text in screen using opengl....
in lines 687-692 it doesnt show anything in screen at all
but using same function in 819 it works great
also in 891 works great
any ideas what could happen ???
 
9:43 PM
Holy codedump, Batman!
 
10:40 PM
1 message moved to bin
 
heh
 
no ideas ??
 
having a look -
@EduardoGutierrez: nothing pops out at me.
could you tell us what you've tried to debug it?
 
11:02 PM
an eclipse project... the problem is that the same code works perfect with same situation and syntax.. and the other doesnt work...
i want to show a message of game over but it doesnt show.... the information about lives scores and other stuff works...
 
sorry, must be a language barrier issue
what things did you do to try to debug the problem?
for example, did you try to step debug through the code and look at the variables?
 
i use the same function and ive tried to change the numbers to locate it.. but the function works in many places
 

« first day (21 days earlier)      last day (38 days later) »