R_SetupGL
()
| 715 | * R_SetupGL |
| 716 | */ |
| 717 | void R_SetupGL() { |
| 718 | |
| 719 | // |
| 720 | // set up viewport |
| 721 | // |
| 722 | //int x = (int) Math.floor(r_newrefdef.x * vid.getWidth() / vid.getWidth()); |
| 723 | int x = r_newrefdef.x; |
| 724 | //int x2 = (int) Math.ceil((r_newrefdef.x + r_newrefdef.width) * vid.getWidth() / vid.getWidth()); |
| 725 | int x2 = r_newrefdef.x + r_newrefdef.width; |
| 726 | //int y = (int) Math.floor(vid.getHeight() - r_newrefdef.y * vid.getHeight() / vid.getHeight()); |
| 727 | int y = vid.getHeight() - r_newrefdef.y; |
| 728 | //int y2 = (int) Math.ceil(vid.getHeight() - (r_newrefdef.y + r_newrefdef.height) * vid.getHeight() / vid.getHeight()); |
| 729 | int y2 = vid.getHeight() - (r_newrefdef.y + r_newrefdef.height); |
| 730 | |
| 731 | int w = x2 - x; |
| 732 | int h = y - y2; |
| 733 | |
| 734 | gl.glViewport(x, y2, w, h); |
| 735 | |
| 736 | // |
| 737 | // set up projection matrix |
| 738 | // |
| 739 | float screenaspect = (float) r_newrefdef.width / r_newrefdef.height; |
| 740 | |
| 741 | |
| 742 | gl.glMatrixMode(GL_PROJECTION); |
| 743 | gl.glLoadIdentity(); |
| 744 | //MYgluPerspective(r_newrefdef.fov_y, screenaspect, 4, 4096); |
| 745 | |
| 746 | // CDawg |
| 747 | |
| 748 | if (r_newrefdef.map_view != 0) |
| 749 | MYgluPerspective (r_newrefdef.fov_y, screenaspect, r_newrefdef.map_zoom-100, r_newrefdef.map_zoom+400); |
| 750 | else |
| 751 | MYgluPerspective (r_newrefdef.fov_y, screenaspect, 4, 4096*4); |
| 752 | // CDawg |
| 753 | |
| 754 | gl.glCullFace(GL_FRONT); |
| 755 | |
| 756 | gl.glMatrixMode(GL_MODELVIEW); |
| 757 | gl.glLoadIdentity(); |
| 758 | |
| 759 | gl.glRotatef(-90, 1, 0, 0); // put Z going up |
| 760 | gl.glRotatef(90, 0, 0, 1); // put Z going up |
| 761 | gl.glRotatef(-r_newrefdef.viewangles[2], 1, 0, 0); |
| 762 | gl.glRotatef(-r_newrefdef.viewangles[0], 0, 1, 0); |
| 763 | gl.glRotatef(-r_newrefdef.viewangles[1], 0, 0, 1); |
| 764 | gl.glTranslatef(-r_newrefdef.vieworg[0], -r_newrefdef.vieworg[1], -r_newrefdef.vieworg[2]); |
| 765 | |
| 766 | gl.glGetFloat(GL_MODELVIEW_MATRIX, r_world_matrix); |
| 767 | r_world_matrix.clear(); |
| 768 | |
| 769 | // |
| 770 | // set drawing parms |
| 771 | // |
| 772 | if (gl_cull.value != 0.0f) |
| 773 | gl.glEnable(GL_CULL_FACE); |
| 774 | else |
no test coverage detected