soil

Sampling from a texture in OpenGL is black

眉间皱痕 提交于 2021-02-18 18:12:15
问题 I'm trying out my hand at graphics, following a tutorial at http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_06 Problem: When I try to texture my cube, my sample is black. Screenshot: http://puu.sh/2JP1H.jpg (note: I set blue = uv.x to test my UVs) I looked at the threads OpenGL textures appear just black, and Texture is all black, but it seemed they had different problems. First I load my texture using SOIL image loading library: int w, h; unsigned char* img = SOIL_load

Sampling from a texture in OpenGL is black

大兔子大兔子 提交于 2021-02-18 18:11:37
问题 I'm trying out my hand at graphics, following a tutorial at http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_06 Problem: When I try to texture my cube, my sample is black. Screenshot: http://puu.sh/2JP1H.jpg (note: I set blue = uv.x to test my UVs) I looked at the threads OpenGL textures appear just black, and Texture is all black, but it seemed they had different problems. First I load my texture using SOIL image loading library: int w, h; unsigned char* img = SOIL_load

Sampling from a texture in OpenGL is black

与世无争的帅哥 提交于 2021-02-18 18:07:23
问题 I'm trying out my hand at graphics, following a tutorial at http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_06 Problem: When I try to texture my cube, my sample is black. Screenshot: http://puu.sh/2JP1H.jpg (note: I set blue = uv.x to test my UVs) I looked at the threads OpenGL textures appear just black, and Texture is all black, but it seemed they had different problems. First I load my texture using SOIL image loading library: int w, h; unsigned char* img = SOIL_load

Image loading using openGL, SOIL

丶灬走出姿态 提交于 2020-01-11 07:28:14
问题 I tried a lot of examples for loading and displaying images in openGL using SOIL. while running the source code below, it displays just a wite quad without an image. I tried to open an image called: foto. I placed the image-file in the folder of the program. bool* keyStates = new bool[256]; GLuint texture[0]; void resize(int height, int width) { const float ar = (float) width / (float) height; glViewport(0, 10, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-ar, ar,

SOIL: 'Unable to open file' in C++ and OpenGL with Xcode

泪湿孤枕 提交于 2019-12-21 22:34:45
问题 I'm trying to load a texture file with SOIL. I tried to load an image from the project files and I also tried to load an image from the file system. When I try to load my image from the project SOIL_last_result() gives me the error: Unable to open file But the application runs anyway. When I type in the full path to an image in my system I get (when I build the project): I don't know whats going wrong there. I was reading that it could be, that there are any other errors in the code and that

Compiling OpenGL SOIL on Mac OS X

两盒软妹~` 提交于 2019-12-21 03:57:29
问题 How would I link in or compile SOIL (http://lonesock.net/soil.html) into my C++ OpenGL project on Mac OS X? 回答1: On newer versions of Mac OS X, such as Leopard, you'll have to edit the make file and add '-arch 1386 -arch x86_64' to the CXX macro of the Makefile. After compiling, you'll also have to link in the CoreFoundation.framework in your project. So your final build command might look something like gcc -Wall -lSOIL -framework OpenGL -framework GLUT -framework CoreFoundation 回答2: There's

Simple OpenGL Image Library (SOIL) Uses deprecated functionality?

我的梦境 提交于 2019-12-13 14:08:09
问题 This tutorial states the following regarding the SOIL library: Although SOIL includes functions to automatically create a texture from an image, it uses features that aren't available in modern OpenGL. Because of this we'll simply use SOIL as image loader and create the texture ourselves. That's OK, but what functionality? And what other functions from the library are similarly affected? I have had a google but not turned up any info on this. I have seen it used in opengl es apps also which

multi-threading support in soil for opengl

瘦欲@ 提交于 2019-12-11 13:56:48
问题 My question is, is SOIL (simple opengl image library) thread compatible? Because when I run the following code: Texture = SOIL_load_OGL_texture ( loc.c_str(), SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MIPMAPS | SOIL_FLAG_MULTIPLY_ALPHA | SOIL_FLAG_COMPRESS_TO_DXT | SOIL_FLAG_DDS_LOAD_DIRECT | SOIL_FLAG_INVERT_Y ); (in order to load a texture) outside of a thread it works fine, however when run inside an std::thread it gives me the error Unhandled exception at

Full screenshot to BMP. Issue with bliting and saving

谁都会走 提交于 2019-12-11 05:01:15
问题 I want to take a capture of part of screen and save it into BMP. To save picture I plan with SOIL. Bit bliting functions I get here. Code: bool saveScreen(string path) { string name; SYSTEMTIME sm; GetSystemTime(&sm); name = to_string(sm.wHour) + to_string(sm.wMinute) + to_string(sm.wSecond) + to_string(sm.wMilliseconds) + "_" + to_string(sm.wDay) + to_string(sm.wMonth) + to_string(sm.wYear); path = /*path + "/" +*/ name + ".bmp"; const char *charPath = path.c_str(); BITMAPINFO bmi; auto& hdr

undefined reference to `SOIL_load_OGL_texture'?

夙愿已清 提交于 2019-12-10 21:11:55
问题 I am don't know why this keeps saying: undefined reference to "SOIL_load_OGL_texture This is the code: GLuint loadtex( const char* texname ) { GLuint texture = SOIL_load_OGL_texture( texname, SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT ); glBindTexture( GL_TEXTURE_2D, texture ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR