Results 1 to 2 of 2

Thread: Conversion from opengl to opengl es2 (Shapefile rendering)?

  1. #1
    Join Date
    Sep 2013
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Conversion from opengl to opengl es2 (Shapefile rendering)?

    Hi All,

    Any body can help me to write conversion program for the following code below-

    void draw()
    {

    glClear (GL_COLOR_BUFFER_BIT);
    glColor3f (0.0, 0.0, 1.0);
    glLoadIdentity ();

    //Render Point Shapefile
    glColor3f (0.0, 0.0, 1.0);
    glEnable(GL_POINT_SMOOTH) ;
    glPointSize(5.0);
    //glBegin(GL_POINTS);

    for(unsigned int i=0;i<vPoints.size();i++)
    {
    glVertex2f(vPoints[i].dX,vPoints[i].dY);
    }

    glEnd();

    //Render Line Shapefile
    glColor3f (0.0, 1.0, 0.0);
    for(unsigned int i=0;i<vLines.size();i++)
    {

    glBegin(GL_LINE_STRIP);
    for(unsigned int j=0;j<vLines[i].vPointList.size();j++)
    {
    glVertex2f(vLines[i].vPointList[j].dX,vLines[i].vPointList[j].dY);

    }

    glEnd();
    }

    //Render Polygon Shapefile
    glColor3f(1.0,0.0, 0.0);
    for(unsigned int i=0;i<vPolygons.size();i++)
    {
    glBegin(GL_LINE_LOOP);
    for(unsigned int j=0;j<vPolygons[i].vPointList.size();j++)
    {
    glVertex2f(vPolygons[i].vPointList[j].dX,vPolygons[i].vPointList[j].dY);
    }

    glEnd();
    }

    glFlush();
    }



    GLWidget::GLWidget(QWidget *parent) : QGLWidget(parent) {
    setMouseTracking(true);
    }

    void GLWidget::initializeGL() {
    glClearColor (0.0, 0.0, 0.0, 0.0);
    // glClearColor (1.0, 1.0, 1.0, 1.0);
    glShadeModel (GL_FLAT);
    glEnable (GL_LINE_SMOOTH);
    glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_LINE_SMOOTH);


    //Assign Default Map Bounds to glOrtho
    sBoundingBox.fMaxX=180.0f;
    sBoundingBox.fMaxY=90.0f;
    sBoundingBox.fMinX=-180.0f;
    sBoundingBox.fMinY=-90.0f;
    }

    void GLWidget::resizeGL(int w, int h) {

    OpenShapeFile("test.shp");
    //OpenShapeFile("/root/dev/qt_shape_view/shapeView/Shapefiles/test.shp");
    if(h<=0) h=1 ;
    glViewport (0, 0, (GLsizei) w, (GLsizei) h);
    glMatrixMode (GL_PROJECTION);
    glLoadIdentity ();
    //Assign Bounding Box Coordinates of Shapefile to glOrtho()
    glOrtho(sBoundingBox.fMinX, sBoundingBox.fMaxX,sBoundingBox.fMinY,sBoundingBox .fMaxY,-1,1);
    glMatrixMode(GL_MODELVIEW);
    }

    void GLWidget:aintGL() {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    draw();
    }

    This is written for ubuntu desktop opengl and want to port it to opengl es2.

    Regards,
    swapan

  2. #2
    Join Date
    Sep 2013
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Conversion from opengl to opengl es2 (Shapefile rendering)?

    my prob solved.......

Similar Threads

  1. Shapefile rendering,zooming,paning,editing using shaplib and qt opengl es2
    By swapan_gh in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th December 2013, 07:00
  2. Problem rendering using OpenGL in VM
    By xtal256 in forum Qt Programming
    Replies: 4
    Last Post: 2nd November 2011, 01:10
  3. OpenGL rendering of Qt widgets
    By Luc4 in forum Qt Programming
    Replies: 0
    Last Post: 31st July 2011, 22:35
  4. Cosmetic pen with opengl rendering
    By spepegiuqt in forum Newbie
    Replies: 1
    Last Post: 14th June 2010, 20:37
  5. OpenGL rendering problem
    By spud in forum Qt Programming
    Replies: 5
    Last Post: 27th February 2007, 19:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.