Installing an editor

Hi…

I’ve been using OpenGL on windows and used microsoft visual studio but windows caused some problems to my pc so i’ve installed linux mint…here i could not find something for open gl can anyone help me please?

thank you in advance…

Try Code::Blocks. It has OpenGL project templates out of the box.

You don’t need a special software to write C code or programs that uses OpenGL®. Any text editor will do.

You can take whatever text editor or IDE you like.

Visual Studio® is an IDE. Code::Blocks is also an IDE.

Gedit (GUI, typically on Gnome based systems), Kate (GUI, typically on KDE based systems),
Emacs (commandline), Vim (commandline) and the like are text editors.

The C code itself is compiled by the C compiler, not the fancy text editing program.

thank you #hidefromkgb…Agend D im using OpenGL in c++…visual studio seemes will never be installed on linux …:slight_smile:

JFYI, Agent D has a valid point. As long as you have a proper toolchain for the language and framework set you are using, the editor does not matter. Everything that C::B can do may also be achieved via makefiles or just by typing a bunch of shell commands into a terminal.

i tried using code::blocks
this code is showing me some problems should i include something else?

#include<GL/glew.h>
#include<GL/glut.h>
void Display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
glColor3f(0.2,0.0,0.0);
glVertex2f(10.0,110.0);
glVertex2f(10.0,115.0);
glVertex2f(20.0,115.0);
glVertex2f(20.0,110.0);

    glColor3f(1.0,1.0,0.0);
    glVertex2f(10.0,0.0);
    glVertex2f(10.0,100.0);
    glVertex2f(110.0,100.0);
    glVertex2f(110.0,0.0);

    glColor3f(0.8,0.8,0.8);
    glVertex2f(20.0,60.0);
    glVertex2f(20.0,80.0);
    glVertex2f(40.0,80.0);
    glVertex2f(40.0,60.0);

    glVertex2f(70.0,60.0);
    glVertex2f(70.0,60.0);
    glVertex2f(90.0,80.0);
    glVertex2f(90.0,80.0);

    glVertex2f(70.0,60.0);
    glVertex2f(70.0,80.0);
    glVertex2f(90.0,80.0);
    glVertex2f(90.0,60.0);

    glColor3f(0.0,1.0,1.0);
    glVertex2f(45.0,0.0);
    glVertex2f(45.0,50.0);
    glVertex2f(65.0,50.0);
    glVertex2f(65.0,0.0);
glEnd();
glBegin(GL_TRIANGLES);
    glColor3f(0.9,0.0,0.0);
    glVertex2f(0.0,100.0);
    glVertex2f(55.0,120.0);
    glVertex2f(110.0,100.0);
glEnd();
glFlush();

}
void init()
{
glClearColor(0.0,0.0,0.0,1.0);
glViewport(0,0,110,120);
glOrtho2D(0.0,110.0,0.0,120.0);
}
int main(int a,char* v)
{
glutInitDisplayMode(GLUT_SINGLE);
glutInitWindowSize(110,120);
glutCreateWindow(“Shtepi”);
init();
glutDisplayFunc(Display);
glutMainLoop();
}

Yep.
Firstly, you should add glutInit(&a, v); right before glutInitDisplayMode. Secondly, there`s no such thing as glOrtho2D. What you need is called gluOrtho2D.

[UPD:] Nice drawing, BTW :slight_smile:

thank you man…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.