PCem
changeset 21:b162911b1c10
Removed unused Windows OpenGL files.
| author | TomW |
|---|---|
| date | Sun Oct 13 16:33:43 2013 +0100 |
| parents | 62da6e2cb833 |
| children | 16c3167038d7 |
| files | src/win-opengl.c src/win-opengl.h |
| diffstat | 2 files changed, 0 insertions(+), 151 deletions(-) [+] |
line diff
1.1 --- a/src/win-opengl.c Sat Oct 12 16:20:27 2013 +0100 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,148 +0,0 @@ 1.4 -#define BITMAP WINDOWS_BITMAP 1.5 -#include <windows.h> 1.6 -#undef BITMAP 1.7 -#include <gl\gl.h> 1.8 -#include <gl\glu.h> 1.9 -#include "ibm.h" 1.10 -#include "video.h" 1.11 -#include "win-opengl.h" 1.12 - 1.13 -HDC hDC=NULL; // Private GDI Device Context 1.14 -HGLRC hRC=NULL; // Permanent Rendering Context 1.15 -HWND opengl_hwnd; 1.16 - 1.17 - 1.18 -void opengl_init(HWND h) 1.19 -{ 1.20 - GLuint PixelFormat; 1.21 - PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be 1.22 - { 1.23 - sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor 1.24 - 1, // Version Number 1.25 - PFD_DRAW_TO_WINDOW | // Format Must Support Window 1.26 - PFD_SUPPORT_OPENGL | // Format Must Support OpenGL 1.27 - PFD_DOUBLEBUFFER, // Must Support Double Buffering 1.28 - PFD_TYPE_RGBA, // Request An RGBA Format 1.29 - 16, // Select Our Color Depth 1.30 - 0, 0, 0, 0, 0, 0, // Color Bits Ignored 1.31 - 0, // No Alpha Buffer 1.32 - 0, // Shift Bit Ignored 1.33 - 0, // No Accumulation Buffer 1.34 - 0, 0, 0, 0, // Accumulation Bits Ignored 1.35 - 16, // 16Bit Z-Buffer (Depth Buffer) 1.36 - 0, // No Stencil Buffer 1.37 - 0, // No Auxiliary Buffer 1.38 - PFD_MAIN_PLANE, // Main Drawing Layer 1.39 - 0, // Reserved 1.40 - 0, 0, 0 // Layer Masks Ignored 1.41 - }; 1.42 - 1.43 - if (!(hDC = GetDC(h))) 1.44 - fatal("Couldn't get DC\n"); 1.45 - if (!(PixelFormat = ChoosePixelFormat(hDC, &pfd))) 1.46 - fatal("Couldn't choose pixel format\n"); 1.47 - if (!SetPixelFormat(hDC, PixelFormat, &pfd)) 1.48 - fatal("Couldn't set pixel format\n"); 1.49 - if (!(hRC = wglCreateContext(hDC))) 1.50 - fatal("Couldn't create rendering context\n"); 1.51 - if (!wglMakeCurrent(hDC, hRC)) 1.52 - fatal("Couldn't set rendering context\n"); 1.53 - 1.54 - ShowWindow(h, SW_SHOW); 1.55 - 1.56 - glViewport(0, 0, 200, 200); // Reset The Current Viewport 1.57 - 1.58 - glMatrixMode(GL_PROJECTION); // Select The Projection Matrix 1.59 - glLoadIdentity(); // Reset The Projection Matrix 1.60 - 1.61 - // Calculate The Aspect Ratio Of The Window 1.62 - gluPerspective(45.0f, (GLfloat)200/(GLfloat)200, 0.1f, 100.0f); 1.63 - 1.64 - glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix 1.65 - glLoadIdentity(); // Reset The Modelview Matrix 1.66 - 1.67 - glShadeModel(GL_SMOOTH); // Enable Smooth Shading 1.68 - glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background 1.69 - glClearDepth(1.0f); // Depth Buffer Setup 1.70 - glEnable(GL_DEPTH_TEST); // Enables Depth Testing 1.71 - glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do 1.72 - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations 1.73 - 1.74 - glDisable(GL_ALPHA_TEST); 1.75 - glDisable(GL_BLEND); 1.76 - glEnable(GL_DEPTH_TEST); 1.77 - glDisable(GL_POLYGON_SMOOTH); 1.78 - glDisable(GL_STENCIL_TEST); 1.79 - glEnable(GL_DITHER); 1.80 - glDisable(GL_TEXTURE_2D); 1.81 - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); 1.82 - glClearColor(0.0, 0.0, 0.0, 0.0); 1.83 - 1.84 - glMatrixMode(GL_PROJECTION); 1.85 - glLoadIdentity(); 1.86 - 1.87 - opengl_hwnd = h; 1.88 - atexit(opengl_close); 1.89 - pclog("opengl_init\n"); 1.90 -} 1.91 - 1.92 -void opengl_close() 1.93 -{ 1.94 - pclog("opengl_close\n"); 1.95 - if (hRC) 1.96 - { 1.97 - wglMakeCurrent(NULL, NULL); 1.98 - wglDeleteContext(hRC); 1.99 - hRC = NULL; 1.100 - } 1.101 - if (hDC) 1.102 - { 1.103 - ReleaseDC(opengl_hwnd, hDC); 1.104 - hDC = NULL; 1.105 - } 1.106 -} 1.107 - 1.108 -void opengl_resize(int x, int y) 1.109 -{ 1.110 - x = y = 200; 1.111 - glViewport(0, 0, x, y); // Reset The Current Viewport 1.112 - 1.113 - glMatrixMode(GL_PROJECTION); // Select The Projection Matrix 1.114 - glLoadIdentity(); // Reset The Projection Matrix 1.115 - 1.116 - // Calculate The Aspect Ratio Of The Window 1.117 - gluPerspective(45.0f, (GLfloat)x/(GLfloat)y, 0.1f, 100.0f); 1.118 - 1.119 - glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix 1.120 - glLoadIdentity(); // Reset The Modelview Matrix 1.121 -} 1.122 - 1.123 -void opengl_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h) 1.124 -{ 1.125 - pclog("blit memtoscreen\n"); 1.126 - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer 1.127 - glLoadIdentity(); // Reset The Current Modelview Matrix 1.128 - glColor3f(1.0f, 1.0f, 0.0f); 1.129 - glTranslatef(-1.5f,0.0f,-6.0f); // Move Left 1.5 Units And Into The Screen 6.0 1.130 - glBegin(GL_TRIANGLES); // Drawing Using Triangles 1.131 - glVertex3f( 0.0f, 1.0f, 0.0f); // Top 1.132 - glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left 1.133 - glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right 1.134 - glEnd(); // Finished Drawing The Triangle 1.135 - glTranslatef(3.0f,0.0f,0.0f); // Move Right 3 Units 1.136 - glBegin(GL_QUADS); // Draw A Quad 1.137 - glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left 1.138 - glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right 1.139 - glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right 1.140 - glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left 1.141 - glEnd(); // Done Drawing The Quad 1.142 - 1.143 - SwapBuffers(hDC); 1.144 -} 1.145 - 1.146 -void opengl_blit_memtoscreen_8(int x, int y, int w, int h) 1.147 -{ 1.148 - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 1.149 - glLoadIdentity(); 1.150 - SwapBuffers(hDC); 1.151 -}
