Hey,
I had to create a graphic with g2 graphic library, but the program doesn't draw anything, not even the line. Also, I can't change the font size. I'm using gcc with -Wall -ansi -pedantic -lgd -lX11 -lm and -lg2. I have ubuntu running in virtualbox.
Could you give me some help?
Here's the code:
Code:
#include<stdio.h>
#include<stdlib.h>
#include<g2.h>
#include<g2_X11.h>
#include<math.h>
void funcao1(janela){
const double pi = 4.*atan(1.);
int x;
float y1;
while(x!=600){
y1=sin(2*pi*0.01*x)+300;
g2_pen(janela,2);
g2_plot(janela,x,y1);
x=x+1;
}
return (1);
}
int main(){
int janela;
janela = g2_open_X11(800,600);
g2_line(janela,1,300,1,300);
funcao1(janela);
getchar();
g2_close(janela);
exit(0);
}
Also, could someone explain to me why I couldn't put zero in the return? As far as I know, the function won't return anything or will it?