Click here to Skip to main content
15,900,906 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how does an uninstall exe delete itself? Pin
o m n i8-Dec-09 20:47
o m n i8-Dec-09 20:47 
GeneralRe: how does an uninstall exe delete itself? Pin
includeh108-Dec-09 21:36
includeh108-Dec-09 21:36 
GeneralRe: how does an uninstall exe delete itself? Pin
David Crow9-Dec-09 2:17
David Crow9-Dec-09 2:17 
AnswerRe: how does an uninstall exe delete itself? Pin
David Crow9-Dec-09 2:19
David Crow9-Dec-09 2:19 
QuestionInheritance!!! Pin
Nilesh Hamane8-Dec-09 18:58
Nilesh Hamane8-Dec-09 18:58 
AnswerRe: Inheritance!!! Pin
Cedric Moonen8-Dec-09 20:26
Cedric Moonen8-Dec-09 20:26 
AnswerRe: Inheritance!!! Pin
cheetach8-Dec-09 20:28
cheetach8-Dec-09 20:28 
QuestionCombination C and OpenGL: Making a loop to draw circles [modified] Pin
Chidori-chan8-Dec-09 18:46
Chidori-chan8-Dec-09 18:46 
I'm in the process of making a simple 2D game and I'd like to put my three rows of circles into three loops where 15 are drawn and translated over 28 units for each time, but I've been running into some issues. Could I get ya'll to take a look at my code and explain what I'm doing wrong? Here's my code:





int Circle1 [20];


    for
    (Circle1=0; Circle1<15; Circle1++)
{
   
    glPushMatrix();
    glTranslatef(d+28,455,1);
        random_generator(0,3);
        if (randomValue == 0)
{
    glColor3f(0,.5,0);

}
        else if (randomValue == 1)
{
    glColor3f(.5,0,0);

}
        else
{
    glColor3f(0,0,.5);

}
    glLineWidth(1.0);
    drawCircle(14,200);
    glPopMatrix();
}


when I compile it I get errors for the


(Circle1=0; Circle1<15; Circle1++)



line of code saying:

In function 'displayFunction':
error: incompatible types when assigning to type 'int[20]' from type 'int'
warning: comparison between point and integer
error: lvalue required as increment operand


Ultimately I'm making a game in which you use a cannon to shoot the same color circles, you'll have a five minute timer to get rid of them all. There will be three rows of circles, with one of three randomly generated colors (red, blue or green). I got my random color generation working, but since I had it on every circle in the drawfunction the colors were changing everytime the screen refreshed. So I need to put the random color generation in my main function and use an array to point at my drawCircle function. However I thought it might be easier if I drew my circles with a for loop. It's 15 circles per row and I had been planning on doing three loops so I only had to worry about the x component.

What I was trying to do with that piece of code was to draw my 15 cicles, keep the y component and translate the x component over 28 units for each circle so you have:

OOOOOOOOOOOOOOO


a row of fifteen side by side circles

modified on Wednesday, December 9, 2009 3:01 AM

AnswerRe: Combination C and OpenGL: Making a loop to draw circles Pin
LunaticFringe8-Dec-09 19:43
LunaticFringe8-Dec-09 19:43 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Chidori-chan8-Dec-09 20:35
Chidori-chan8-Dec-09 20:35 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Cedric Moonen8-Dec-09 20:42
Cedric Moonen8-Dec-09 20:42 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Chidori-chan8-Dec-09 20:58
Chidori-chan8-Dec-09 20:58 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Tim Craig8-Dec-09 20:52
Tim Craig8-Dec-09 20:52 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles [modified] Pin
Chidori-chan8-Dec-09 21:29
Chidori-chan8-Dec-09 21:29 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
LunaticFringe9-Dec-09 3:42
LunaticFringe9-Dec-09 3:42 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Chidori-chan9-Dec-09 13:07
Chidori-chan9-Dec-09 13:07 
AnswerRe: Combination C and OpenGL: Making a loop to draw circles Pin
Cedric Moonen8-Dec-09 20:18
Cedric Moonen8-Dec-09 20:18 
QuestionWhy CDC::LineTo(pt) draw a line not include pt Pin
fitatc8-Dec-09 17:49
fitatc8-Dec-09 17:49 
AnswerRe: Why CDC::LineTo(pt) draw a line not include pt Pin
Richard MacCutchan8-Dec-09 22:06
mveRichard MacCutchan8-Dec-09 22:06 
GeneralRe: Why CDC::LineTo(pt) draw a line not include pt Pin
fitatc9-Dec-09 14:43
fitatc9-Dec-09 14:43 
GeneralRe: Why CDC::LineTo(pt) draw a line not include pt Pin
Richard MacCutchan9-Dec-09 23:18
mveRichard MacCutchan9-Dec-09 23:18 
GeneralRe: Why CDC::LineTo(pt) draw a line not include pt Pin
fitatc10-Dec-09 13:34
fitatc10-Dec-09 13:34 
QuestionDe Boor method to draw Bspline ?? Pin
a04.lqd8-Dec-09 16:54
a04.lqd8-Dec-09 16:54 
AnswerRe: De Boor method to draw Bspline ?? Pin
loyal ginger8-Dec-09 17:40
loyal ginger8-Dec-09 17:40 
GeneralCoding Team Needed in Advanced Artificial Intelligence Project-Project Vital Pin
Gabe Parmley8-Dec-09 15:54
Gabe Parmley8-Dec-09 15:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.