From 590b7542552533d15237808f7d050e0b564d78c4 Mon Sep 17 00:00:00 2001 From: Caesar2011 Date: Thu, 1 Sep 2016 02:09:58 +0200 Subject: [PATCH] Cleanup files --- .gitignore | 11 +- .../imanox-chroma-matting-opengl.cbp | 52 --- .../imanox-chroma-matting-opengl.depend | 12 - .../imanox-chroma-matting-opengl.layout | 9 - imanox-chroma-matting-opengl/main.cpp | 301 ---------------- load-image-opengl/img/foregrounds/1.jpeg | Bin 16284 -> 0 bytes load-image-opengl/img/foregrounds/2.jpeg | Bin 708 -> 0 bytes load-image-opengl/load-image-opengl.cbp | 49 --- load-image-opengl/load-image-opengl.depend | 9 - load-image-opengl/main.cpp | 339 ------------------ 10 files changed, 7 insertions(+), 775 deletions(-) delete mode 100644 imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.cbp delete mode 100644 imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.depend delete mode 100644 imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.layout delete mode 100644 imanox-chroma-matting-opengl/main.cpp delete mode 100644 load-image-opengl/img/foregrounds/1.jpeg delete mode 100644 load-image-opengl/img/foregrounds/2.jpeg delete mode 100644 load-image-opengl/load-image-opengl.cbp delete mode 100644 load-image-opengl/load-image-opengl.depend delete mode 100644 load-image-opengl/main.cpp diff --git a/.gitignore b/.gitignore index 35fc333..8cc0d2a 100644 --- a/.gitignore +++ b/.gitignore @@ -46,10 +46,10 @@ *.lo # Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib +#*.dll +#*.so +#*.so.* +#*.dylib # Executables *.exe @@ -62,3 +62,6 @@ # Debug files *.dSYM/ + +# CodeBlocks-Layout +*.layout diff --git a/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.cbp b/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.cbp deleted file mode 100644 index 56d6c8f..0000000 --- a/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.cbp +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - diff --git a/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.depend b/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.depend deleted file mode 100644 index af8f84e..0000000 --- a/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.depend +++ /dev/null @@ -1,12 +0,0 @@ -# depslib dependency file v1.0 -1472543008 source:c:\users\sebastian\documents\git-repos\imanox-chroma-matting\imanox-chroma-matting-opengl\main.c - - - -1472553612 source:c:\users\sebastian\documents\git-repos\imanox-chroma-matting\imanox-chroma-matting-opengl\main.cpp - - - - - - diff --git a/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.layout b/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.layout deleted file mode 100644 index f7595bc..0000000 --- a/imanox-chroma-matting-opengl/imanox-chroma-matting-opengl.layout +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/imanox-chroma-matting-opengl/main.cpp b/imanox-chroma-matting-opengl/main.cpp deleted file mode 100644 index ef20d38..0000000 --- a/imanox-chroma-matting-opengl/main.cpp +++ /dev/null @@ -1,301 +0,0 @@ -#include -#include -#include -#include -#include -#include - -using namespace std; - -LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM); -void EnableOpenGL(HWND hwnd, HDC*, HGLRC*); -void DisableOpenGL(HWND, HDC, HGLRC); - - -int * loadJpg(const char* Name) { - unsigned char a, r, g, b; - int width, height; - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - - FILE * infile; /* source file */ - JSAMPARRAY pJpegBuffer; /* Output row buffer */ - int row_stride; /* physical row width in output buffer */ - if ((infile = fopen(Name, "rb")) == NULL) { - fprintf(stderr, "can't open %s\n", Name); - return 0; - } - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_decompress(&cinfo); - jpeg_stdio_src(&cinfo, infile); - (void) jpeg_read_header(&cinfo, TRUE); - (void) jpeg_start_decompress(&cinfo); - width = cinfo.output_width; - height = cinfo.output_height; - - unsigned char * pDummy = new unsigned char [width*height*4]; - unsigned char * pTest = pDummy; - if (!pDummy) { - printf("NO MEM FOR JPEG CONVERT!\n"); - return 0; - } - row_stride = width * cinfo.output_components; - pJpegBuffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - - while (cinfo.output_scanline < cinfo.output_height) { - (void) jpeg_read_scanlines(&cinfo, pJpegBuffer, 1); - for (int x = 0; x < width; x++) { - a = 0; // alpha value is not supported on jpg - r = pJpegBuffer[0][cinfo.output_components * x]; - if (cinfo.output_components > 2) { - g = pJpegBuffer[0][cinfo.output_components * x + 1]; - b = pJpegBuffer[0][cinfo.output_components * x + 2]; - } else { - g = r; - b = r; - } - *(pDummy++) = b; - *(pDummy++) = g; - *(pDummy++) = r; - *(pDummy++) = a; - } - } - fclose(infile); - (void) jpeg_finish_decompress(&cinfo); - jpeg_destroy_decompress(&cinfo); - - /*BMap = (int*)pTest; - Height = height; - Width = width; - Depth = 32;*/ - int * pJetze = (int*)pTest; - cout << width << endl; - return pJetze; -} - -int WINAPI WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpCmdLine, - int nCmdShow) -{ - WNDCLASSEX wcex; - HWND hwnd; - HDC hDC; - HGLRC hRC; - MSG msg; - BOOL bQuit = FALSE; - float theta = 0.0f; - - /* register window class */ - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.style = CS_OWNDC; - wcex.lpfnWndProc = WindowProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = hInstance; - wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); - wcex.lpszMenuName = NULL; - wcex.lpszClassName = "GLSample"; - wcex.hIconSm = LoadIcon(NULL, IDI_APPLICATION);; - - - int * pJetze = loadJpg("../img/foregrounds/2.jpeg"); - cout << pJetze[0] << endl; - cout << pJetze[1] << endl; - cout << pJetze[2] << endl; - cout << pJetze[3] << endl; - cout << "Hello world!" << endl; - //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 10, 10, 0, GL_RGBA8, GL_UNSIGNED_INT, pJetze); - - - if (!RegisterClassEx(&wcex)) - return 0; - - /* create main window */ - hwnd = CreateWindowEx(0, - "GLSample", - "OpenGL Sample", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - 256, - 256, - NULL, - NULL, - hInstance, - NULL); - - ShowWindow(hwnd, nCmdShow); - - /* enable OpenGL for the window */ - EnableOpenGL(hwnd, &hDC, &hRC); - - /* program main loop */ - bool first = true; - while (!bQuit) - { - /* check for messages */ - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - /* handle or dispatch messages */ - if (msg.message == WM_QUIT) - { - bQuit = TRUE; - } - else - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - else - { - if (first) { - first = false; - - - GLuint textureid; - glGenTextures(1, &textureid); - glBindTexture(GL_TEXTURE_2D, textureid); - // Black/white checkerboard - float pixels[] = { - 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f - }; - //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_FLOAT, pixels); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 10, 10, 0, GL_RGBA8, GL_UNSIGNED_BYTE, pJetze); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - - glBindTexture(GL_TEXTURE_2D, textureid); - glBegin(GL_TRIANGLES); - - glTexCoord2f(0, 0); glVertex3f( -2, 0, -2 ); - glTexCoord2f(2, 0); glVertex3f( 2, 0, -2 ); - glTexCoord2f(0, 2); glVertex3f( -2, 2, -2 ); - - glEnd(); - SwapBuffers(hDC); - - } - /* OpenGL animation code goes here */ - - //glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - //glClear(GL_COLOR_BUFFER_BIT); - - /*glBindTexture(GL_TEXTURE_2D, *pJetze); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 10, 10, 0, GL_RGBA8, GL_UNSIGNED_BYTE, &pJetze); - - GLuint textures; - glGenTextures(1, &textures); - int width, height; - unsigned char* image; - - //glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, textures); - //image = SOIL_load_image("sample.png", &width, &height, 0, SOIL_LOAD_RGB); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 10, 10, 0, GL_RGBA8, - GL_UNSIGNED_BYTE, pJetze); - //SOIL_free_image_data(image); - //glUniform1i(glGetUniformLocation(shaderProgram, "texKitten"), 0); - - glPushMatrix(); - glRotatef(theta, 0.0f, 0.0f, 1.0f); - - glBegin(GL_TRIANGLES); - - glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.0f, 1.0f); - glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.87f, -0.5f); - glColor3f(0.0f, 0.0f, 1.0f); glVertex2f(-0.87f, -0.5f); - - glEnd(); - - glPopMatrix(); - - SwapBuffers(hDC); - - theta += 1.0f; - - Sleep (1);\**/ - } - } - - /* shutdown OpenGL */ - DisableOpenGL(hwnd, hDC, hRC); - - /* destroy the window explicitly */ - DestroyWindow(hwnd); - - return msg.wParam; -} - -LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) - { - case WM_CLOSE: - PostQuitMessage(0); - break; - - case WM_DESTROY: - return 0; - - case WM_KEYDOWN: - { - switch (wParam) - { - case VK_ESCAPE: - PostQuitMessage(0); - break; - } - } - break; - - default: - return DefWindowProc(hwnd, uMsg, wParam, lParam); - } - - return 0; -} - -void EnableOpenGL(HWND hwnd, HDC* hDC, HGLRC* hRC) -{ - PIXELFORMATDESCRIPTOR pfd; - - int iFormat; - - /* get the device context (DC) */ - *hDC = GetDC(hwnd); - - /* set the pixel format for the DC */ - ZeroMemory(&pfd, sizeof(pfd)); - - pfd.nSize = sizeof(pfd); - pfd.nVersion = 1; - pfd.dwFlags = PFD_DRAW_TO_WINDOW | - PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.cColorBits = 24; - pfd.cDepthBits = 16; - pfd.iLayerType = PFD_MAIN_PLANE; - - iFormat = ChoosePixelFormat(*hDC, &pfd); - - SetPixelFormat(*hDC, iFormat, &pfd); - - /* create and enable the render context (RC) */ - *hRC = wglCreateContext(*hDC); - - wglMakeCurrent(*hDC, *hRC); -} - -void DisableOpenGL (HWND hwnd, HDC hDC, HGLRC hRC) -{ - wglMakeCurrent(NULL, NULL); - wglDeleteContext(hRC); - ReleaseDC(hwnd, hDC); -} - diff --git a/load-image-opengl/img/foregrounds/1.jpeg b/load-image-opengl/img/foregrounds/1.jpeg deleted file mode 100644 index dfd4d14fbbd915a0628191304e72ba63ad08eeb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16284 zcmd^m2T)U8*Y2Ssh!g=qkbodnK$=os6GW*>F9D>esPqof2_i*7h#*Cf-a-)~O%RZv z2uO)Ym)?6XAwb%V@B7X7efOV#?)>-8oqPZB-7{HdpS4diYiIAh*0ahX{Upr*EIJz6 z8UO_)Kp92}0{{{cV7YVuiJgLil#HU3%oSOHG!EPZ=ouIo85o)VY%I(y|7vV(Y#baM zWXi(A#>URh!Ex@~IWmKM;pXP%kRyGi$O8Zh8j3#~@Q+48NkvUVOGkf- zfsq2B`fH3#{~G;onwtDGA>=WDnw5r4K;{PRS;PBu7d_c!pC;te z3#wIq<}m8p5t4i06@H3=^BfoV`AfngqGICm3RkZwDk({pSj&Ge^{R4wT!y`XO$7bi|7Z#V6S60_{_x2AkhuEXz6IQawl+@Hz)O5c@rl9mA zf2dfg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F)U9xRE@UzkJWgv?z0QKpbZs zFD%wusOh~Ms;ROq*>ZWZ_@m+mU;b2SU5_$BA};>Kyx|@atFKS2b&x9HDVBhL4fXkY z^`>yW?G*2xQ+>22u4emMz&HNosdrzhRKl19B%X7iFU2Sc8V*qH70?^Fo^3sPkGAC; zrK-HZq%rIg_#L`(_C(U@O&rB5=G1LnIsyiIuRfaJ-RjKox`}SVJrYo!K&UVC7;ov| zGoo5kx4)Jvo2n+<>FVNklRvqV$A^D+dVF{Lu5YIEdG);tWwW^8C8xP%UFjF<(*uY# z?$P1&4B)h$os{e81 zKYRMWIZuq9nkDeOr6@p^n%%mibz3m0*M(BzqCV4Yyd*b%g!~s<6F9aF(7Z;bf*VyxouI=B=;$G67ZEV_w<5r9{qbl}0ZyYTjLlJ$p7K9SDY3D8Qos;OaA4Kd# z@W-Y3R_`+vsPF;QET0FM2xHiG6Ta;~rp+ZDUogTLFejp9ewM0eX&pn^oVMf{bZh^; zqW(Luqa!?R z!R4=55&5YQi8aw7)0~2a^mcKvOL?08eZ{41+UMIu%Ou&9W33+zQpmngapN+>H-P%< z1nX-Wa85bHMgN4AG66&zXKvGQT}I4U{uG0zIP#OEI;q5drrGIFx7+U zau;EOW~nA0NkEZ3k&5gjzk7TasxS|2S!eP{Co{hOu1+_+$mj8-cI{r`~TUdd%&P$DM}gX zLEd!~zhV7y`%w(zi>C6hHzP{G+5NzbAn3Wp_w)DgB;YHw+W53XU|x19dCo>t1FqYZI^?i_ z-ACKzHHy4Ms^B(l^Ax|A%&nsv(Pamk;Msvf$xD*J4c%X_d9hu|OH2u4HT#8Rgzl5W bHk4eyfLfSnUSb$U?63R(+lG#cH2OaP`d3o> diff --git a/load-image-opengl/img/foregrounds/2.jpeg b/load-image-opengl/img/foregrounds/2.jpeg deleted file mode 100644 index 770ed2b7109032c8efc79db9b0370dccae659f89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 708 zcmex= zRY=j$kxe)-kzJ`!#HexNLJno8jR!@8E`CrkPAY2R|V^&07y2J$~}^+4C1KUw!=a z`ODXD-+%o41@ado12e>1aG#<1OAzQUCSV+}u!H=?$W#u*%z`YeiiT`Lj)Clng~Cck zjT|CQ6Blkg$f;}`^g%SK=pvVxipfLOk07sseMX$en#l4Q++zrT-D2QjW&}navmk># z!_P^_j=zb|NZWBmKTkjJo&LLZ>))sC-L+@Oy!3gQOJ}8Js!Z}sDNid?nWi#pUYGWV qNWY-TQ|8{bzd6TDs!y(`;77#@Cr*u{Kvj_{(>hfbdAs!gzX<>~H0OT+ diff --git a/load-image-opengl/load-image-opengl.cbp b/load-image-opengl/load-image-opengl.cbp deleted file mode 100644 index 41e3661..0000000 --- a/load-image-opengl/load-image-opengl.cbp +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - diff --git a/load-image-opengl/load-image-opengl.depend b/load-image-opengl/load-image-opengl.depend deleted file mode 100644 index ae08add..0000000 --- a/load-image-opengl/load-image-opengl.depend +++ /dev/null @@ -1,9 +0,0 @@ -# depslib dependency file v1.0 -1472655954 source:c:\users\sebastian\documents\git-repos\imanox-chroma-matting\load-image-opengl\main.cpp - - - - - - - diff --git a/load-image-opengl/main.cpp b/load-image-opengl/main.cpp deleted file mode 100644 index 8331d79..0000000 --- a/load-image-opengl/main.cpp +++ /dev/null @@ -1,339 +0,0 @@ -#include -#include -#include -#include -#include -#include -using namespace std; - -LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM); -void EnableOpenGL(HWND hwnd, HDC*, HGLRC*); -void DisableOpenGL(HWND, HDC, HGLRC); -GLuint LoadTexture(char *filename,int *textw,int *texth); -void DrawTexture(int x, int y, GLuint textureid,int textw,int texth); -int * loadJpg(const char* Name); - - -int WINAPI WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpCmdLine, - int nCmdShow) -{ - WNDCLASSEX wcex; - HWND hwnd; - HDC hDC; - HGLRC hRC; - MSG msg; - BOOL bQuit = FALSE; - float theta = 0.0f; - - - - - /* register window class */ - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.style = CS_OWNDC; - wcex.lpfnWndProc = WindowProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = hInstance; - wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); - wcex.lpszMenuName = NULL; - wcex.lpszClassName = "GLSample"; - wcex.hIconSm = LoadIcon(NULL, IDI_APPLICATION);; - - - if (!RegisterClassEx(&wcex)) - return 0; - - /* create main window */ - hwnd = CreateWindowEx(0, - "GLSample", - "OpenGL Sample", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - 256, - 256, - NULL, - NULL, - hInstance, - NULL); - - ShowWindow(hwnd, nCmdShow); - - /* enable OpenGL for the window */ - EnableOpenGL(hwnd, &hDC, &hRC); - - /* program main loop */ - while (!bQuit) - { - /* check for messages */ - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - /* handle or dispatch messages */ - if (msg.message == WM_QUIT) - { - bQuit = TRUE; - } - else - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - else - { - /* OpenGL animation code goes here */ - - /*glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - glPushMatrix(); - glRotatef(theta, 0.0f, 0.0f, 1.0f); - - glBegin(GL_TRIANGLES); - - glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.0f, 1.0f); - glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.87f, -0.5f); - glColor3f(0.0f, 0.0f, 1.0f); glVertex2f(-0.87f, -0.5f); - - glEnd(); - - glPopMatrix(); - - SwapBuffers(hDC); - - theta += 1.0f;*/ - - - GLuint myglu; - int textw, texth; - - string tmp = "img/foregrounds/2.jpeg"; - char tab2[1024]; - strncpy(tab2, tmp.c_str(), sizeof(tab2)); - tab2[sizeof(tab2) - 1] = 0; - - - myglu=LoadTexture(tab2,&textw,&texth); - DrawTexture(100,100,myglu,textw,texth); - - SwapBuffers(hDC); - - Sleep (1); - } - } - - /* shutdown OpenGL */ - DisableOpenGL(hwnd, hDC, hRC); - - /* destroy the window explicitly */ - DestroyWindow(hwnd); - - return msg.wParam; -} - -LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) - { - case WM_CLOSE: - PostQuitMessage(0); - break; - - case WM_DESTROY: - return 0; - - case WM_KEYDOWN: - { - switch (wParam) - { - case VK_ESCAPE: - PostQuitMessage(0); - break; - } - } - break; - - default: - return DefWindowProc(hwnd, uMsg, wParam, lParam); - } - - return 0; -} - -void EnableOpenGL(HWND hwnd, HDC* hDC, HGLRC* hRC) -{ - PIXELFORMATDESCRIPTOR pfd; - - int iFormat; - - /* get the device context (DC) */ - *hDC = GetDC(hwnd); - - /* set the pixel format for the DC */ - ZeroMemory(&pfd, sizeof(pfd)); - - pfd.nSize = sizeof(pfd); - pfd.nVersion = 1; - pfd.dwFlags = PFD_DRAW_TO_WINDOW | - PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.cColorBits = 24; - pfd.cDepthBits = 16; - pfd.iLayerType = PFD_MAIN_PLANE; - - iFormat = ChoosePixelFormat(*hDC, &pfd); - - SetPixelFormat(*hDC, iFormat, &pfd); - - /* create and enable the render context (RC) */ - *hRC = wglCreateContext(*hDC); - - wglMakeCurrent(*hDC, *hRC); -} - -void DisableOpenGL (HWND hwnd, HDC hDC, HGLRC hRC) -{ - wglMakeCurrent(NULL, NULL); - wglDeleteContext(hRC); - ReleaseDC(hwnd, hDC); -} - - - - - - - - - - -GLuint LoadTexture(char *filename,int *textw,int *texth) { - - GLuint textureid; - int mode = GL_RGBA; - - //surface = IMG_Load(filename); - - int * pixels = loadJpg(filename); - - *textw=10; - *texth=10; - // create one texture name - glGenTextures(1, &textureid); - - // tell opengl to use the generated texture name - glBindTexture(GL_TEXTURE_2D, textureid); - - // this reads from the sdl surface and puts it into an opengl texture - glTexImage2D(GL_TEXTURE_2D, 0, mode, 10, 10, 0, mode, GL_UNSIGNED_BYTE, pixels); - - // these affect how this texture is drawn later on... - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); - - return textureid; - -} - - - -void DrawTexture(int x, int y, GLuint textureid,int textw,int texth) { - - //int textw,texth; - // tell opengl to use the generated texture name - glBindTexture(GL_TEXTURE_2D, textureid); - glEnable(GL_TEXTURE_2D); - - // make a rectangle - glBegin(GL_QUADS); - - // top left - glTexCoord2i(0, 0); - glVertex3f(x, y, 0); - - // top right - glTexCoord2i(1, 0); - glVertex3f(x+textw, y, 0); - - // bottom right - glTexCoord2i(1, 1); - glVertex3f(x+textw, y+texth, 0); - - // bottom left - glTexCoord2i(0, 1); - glVertex3f(x, y+texth, 0); - - glEnd(); - - glDisable(GL_TEXTURE_2D ); -} - - - - -int * loadJpg(const char* Name) { - unsigned char a, r, g, b; - int width, height; - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - - FILE * infile; /* source file */ - JSAMPARRAY pJpegBuffer; /* Output row buffer */ - int row_stride; /* physical row width in output buffer */ - if ((infile = fopen(Name, "rb")) == NULL) { - fprintf(stderr, "can't open %s\n", Name); - return 0; - } - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_decompress(&cinfo); - jpeg_stdio_src(&cinfo, infile); - (void) jpeg_read_header(&cinfo, TRUE); - (void) jpeg_start_decompress(&cinfo); - width = cinfo.output_width; - height = cinfo.output_height; - - unsigned char * pDummy = new unsigned char [width*height*4]; - unsigned char * pTest = pDummy; - if (!pDummy) { - printf("NO MEM FOR JPEG CONVERT!\n"); - return 0; - } - row_stride = width * cinfo.output_components; - pJpegBuffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - - while (cinfo.output_scanline < cinfo.output_height) { - (void) jpeg_read_scanlines(&cinfo, pJpegBuffer, 1); - for (int x = 0; x < width; x++) { - a = 0; // alpha value is not supported on jpg - r = pJpegBuffer[0][cinfo.output_components * x]; - if (cinfo.output_components > 2) { - g = pJpegBuffer[0][cinfo.output_components * x + 1]; - b = pJpegBuffer[0][cinfo.output_components * x + 2]; - } else { - g = r; - b = r; - } - *(pDummy++) = b; - *(pDummy++) = g; - *(pDummy++) = r; - *(pDummy++) = a; - } - } - fclose(infile); - (void) jpeg_finish_decompress(&cinfo); - jpeg_destroy_decompress(&cinfo); - - /*BMap = (int*)pTest; - Height = height; - Width = width; - Depth = 32;*/ - int * pJetze = (int*)pTest; - cout << width << endl; - return pJetze; -}