Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

apit

can we create .dll and .lib file using openGL?

This topic is 5455 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have create a program to split window to two view using glut.. now i want to make the program as a library(.dll and .lib)... can i do that? this is my code:: quote: -------------------------------------------------------------------------------- #include <gl\glut.h> #include <gl\gl.h> #include <gl\glu.h> #include <math.h> #include <stdlib.h> #include "split.h" void changeSize(int w1, int h1) { // elakkan devide by zero ratio = 1.0f * w1 / h1; // Reset koordinat gl_projection sebelum diubahsuai glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Set viewport kpd keseluruhan window glViewport(0, 0, w1, h1); //(0,0)=specifies lower-left coner of the viewport // Set the clipping volume gluPerspective(45,ratio,0.1,1000); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void SeparateWindow(int w1,int h1) { if(h1 == 0) h1 = 1; w = w1; h = h1; //Separate Window Sebelah Kiri glutSetWindow(subWindowKiri); glutPositionWindow(border,border); glutReshapeWindow(w/2-border*3/2,h-2*border);//w-2*border, h/2 - border*3/2);-devide atas bawah changeSize(w/2-border*3/2,h-2*border);//w-2*border, h/2 - border*3/2);-devide atas bawah //Separate Window Sebelah Kanan glutSetWindow(subWindowKanan); glutPositionWindow((w+border)/2,border); glutReshapeWindow(w/2-border*3/2,h-2*border);//w-2*border, h/2 - border*3/2); changeSize(w/2-border*3/2,h-2*border);//w-2*border,h/2 - border*3/2); } void DrawTriangle(int x) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); //glRotatef(angle,0.0,1.0,0.0); glColor3f(0.0,0.0,1.0); //glScalef(10.0,0.0,0.0); //glTranslatef(0.0f, 0.0f, -2.0f); //draw triangle glBegin(GL_TRIANGLES); glVertex3f(-2.0,1.0,0.0); glVertex3f(3.0,1.0,0.0); glVertex3f(0.0,3.0,0.0); glEnd(); glPopMatrix(); angle++; glutSwapBuffers(); } void renderScene() { glutSetWindow(mainWindow); glClear(GL_COLOR_BUFFER_BIT); glutSwapBuffers(); } void renderSceneKiri() { glutSetWindow(subWindowKiri); glLoadIdentity(); gluLookAt(x, y, z, 0.11285,y+ly,0.222,//x + lx,y + ly,z + lz, 0.0f,1.0f,0.0f); DrawTriangle(subWindowKiri); } void renderSceneKanan() { glutSetWindow(subWindowKanan); glLoadIdentity(); gluLookAt(x, y, z, //lokasi kamera - nilai (0,0,0)= asalan -0.11285,y+ly,0.222,//x + lx,y + ly,z + lz, //dimana camera halakan/point = line of sight 0.0f,1.0f,0.0f); //vektor yg menerangkan arah atas DrawTriangle(subWindowKanan); } void renderSceneAll() { renderSceneKiri(); renderSceneKanan(); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(100,100); glutInitWindowSize(w,h); mainWindow = glutCreateWindow("Two View"); glutReshapeFunc(SeparateWindow); glutDisplayFunc(renderScene); glutIdleFunc(renderSceneAll); //Separate Window Sebelah Kiri //identifier |window |window |width in |height //sub window |x location |y location |pixel |in pixel subWindowKiri = glutCreateSubWindow(mainWindow, border ,border ,w/2-border*3/2,h-2*border);//w-2*border, h/2 - border*3/2); glutDisplayFunc(renderSceneKiri); //Separate Window Sebelah Kanan subWindowKanan = glutCreateSubWindow(mainWindow, (w+border)/2,border,w/2-border*3/2,h-2*border);//w-2*border, h/2 - border*3/2); glutDisplayFunc(renderSceneKanan); glutMainLoop(); return(0); }

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!