3d - OpenGL,SOIL: Can I load a small png file or any size I want? -


i'm learning opengl , used soil lib map texture(png file) quad (follow nehe tutorials).nehe used image size 256x256. can use smaller picture ?(any size or power of 2 size) ? load texture function:

int loadgltextures()                                     {       texture[0] = soil_load_ogl_texture         (         "nehe.png",        soil_load_auto,         soil_create_new_id, soil_flag_mipmaps | soil_flag_invert_y | soil_flag_ntsc_safe_rgb | soil_flag_compress_to_dxt |soil_flag_power_of_two          );      if(texture[0] == 0)         return false;      //glgentextures(1, &texture[0]);     glbindtexture(gl_texture_2d, texture[0]);     gltexparameteri(gl_texture_2d,gl_texture_min_filter,gl_linear);     gltexparameteri(gl_texture_2d,gl_texture_mag_filter,gl_linear);       return true;                                        // return success } 

i think have re size picture photoshop or same software , aware picture size should power of 2 , between 64 , 256.and there no need code that, size of opengl screen want use loading picture can determined coding;)


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -