Menos Temat założony przez niniejszego użytkownika |
[OpenGL, GLUT, C++] Ładowanie tekstur » 2013-04-30 21:37:26 Witam. Pobrałem gotowy Loadres plików bmp, do tekstur . Uruchamiam program... i błąd.. Siedze nad tym już 3 dzień i nie moge zrozumieć o co chodzi.. #include <windows.h> #define GLUT_DISABLE_ATEXIT_HACK #include <gl/glut.h> #include <gl/glu.h> #include <gl/gl.h> #include <math.h> #include "imageloader.h"
void BezruchMyszy( int mx, int my ); void idle( int val ); void pressKey( int key, int x, int y ); void releaseKey( int key, int x, int y ); void processNormalKeys( unsigned char key, int x, int y ); void domek( float dl ); void zorientujMnie( float ang, float angy ); void ruchMyszki( int mx, int my ); void BezruchMyszy( int mx, int my ); void MyszWyszla( int stan ); void Mysz( int klawisz, int stan, int mx, int my ); void PlaskiRuch( int i ); void Reshape( int w, int h ); void renderScene( void ); void createMenus(); GLuint loadTexture( Image * image ); void zaladujObrazy();
int wys, szer; float kat = 0.0, katY = 0.0, deltakat = 0.0, deltakatY = 0.0, ratio; float x = 0.0, y = 0.75, z = 5.0; float lx = 0.0, ly = 0.0, lz = - 1.0; int deltaRuch = 0; int kolorT = 0, kolorZ = 0, ksztaltF = 0;
GLuint _textureId, _textureId2, _textureId3;
GLuint loadTexture( Image * image ) { GLuint textureId; glGenTextures( 1, & textureId ); glBindTexture( GL_TEXTURE_2D, textureId ); glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, image->width, image->height, 0, GL_RGB, GL_UNSIGNED_BYTE, image->pixels ); return textureId; } void idle( int val ) { glutPostRedisplay(); } void zaladujObrazy() { Image * image = loadBMP( "domek.bmp" ); _textureId = loadTexture( image ); delete image; }
Loader mam z : http://www.videotutorialsrock.com/opengl_tutorial/textures/text.php A taki mam błąd: Assertion failed (!input.fail() )|| (!"Could not find file") |
|
akwes |
» 2013-04-30 21:41:49 I błąd Ci nic nie mówi? |
|
Menos Temat założony przez niniejszego użytkownika |
» 2013-04-30 21:44:52 Właśnie nie wiem o co w niej chodzi za bardzo..... pododawałem pliki zainckludowałem pliki od loadera.. I nie wiem.... |
|
Gabes |
» 2013-04-30 22:02:20 Twoja bitmapa powinna mieć 24-bitową głębie kolorów. |
|
Menos Temat założony przez niniejszego użytkownika |
» 2013-04-30 22:06:23 Mam 24 oraz 8. Nie działa... |
|
SeaMonster131 |
» 2013-04-30 22:06:55 Gdzie znajduje się plik graficzny, który wczytujesz? |
|
akwes |
» 2013-04-30 22:07:40 Image * loadBMP( const char * filename ) { ifstream input; input.open( filename, ifstream::binary ); assert( !input.fail() || !"Could not find file" );
@up, zgadnij ;> Pewnie nie tam gdzie powinien. |
|
Menos Temat założony przez niniejszego użytkownika |
» 2013-04-30 22:08:11 Tam gdzie main.cpp w którym jest cały kod, w tym samym katalogu |
|
« 1 » 2 3 4 |