Ver la versión completa : Cargar PNG
ZeNiTRaM
17/11/2005, 00:44
Estoy buscando alguna funcion (preferiblemente ya hecha :rolleyes: ) o cualquier otra forma de cargar PNGs con el SDK oficial sin romperme la cabeza... alguien sabe de alguna? (preferiblemente sin recurrir a SDL)
Gracias por adelantado..
P.D: Necesito que sea en PNG para asi poder cargar directamente unas skins de cierta consola (hagan sus apuestas) sin tener que reconvertirlas..
P.D2: Si no uso el Buscar es porque el termino PNG es demasiado corto.. :shock:
P.D3: Se me fue la mano y lo envie a Programacion GP2X.. esto va aqui :rolleyes:
busca la libpng :D
en serio, en el codigo fuente de las sdl para gp32, viene facilmente reconocible la libpng, creo que seria facil coger el .c y el .h de la libreria y compilarlos con tu programa ;)
PD. O lo mismo incluso viene la propia libpng ya compilada, porque me suena que aunque uso SDL, en en algun sitio he puesto un -lpng y funciona :D
Aiken
ZeNiTRaM
17/11/2005, 04:25
Bueno, ya he conseguido meter la libpng tras editar varios archivos, ahora solo queda cargar el PNG.. he encontrado esta funcion que los carga http://www.gp32.co.nz/snippet_view.php?snippet_id=23 pero al simplemente incluirla en el codigo fuente me da este error..
Compiling gpmain ...
gpmain.c:24: error: syntax error before '*' token
gpmain.c:24: warning: return type defaults to 'int'
gpmain.c: In function 'gp_canvasCreateFromPng':
gpmain.c:26: error: 'GPFILE' undeclared (first use in this function)
gpmain.c:26: error: (Each undeclared identifier is reported only once
gpmain.c:26: error: for each function it appears in.)
gpmain.c:26: error: 'pngfile' undeclared (first use in this function)
gpmain.c:28: error: 'tGP_canvas' undeclared (first use in this function)
gpmain.c:28: error: 'canvas' undeclared (first use in this function)
gpmain.c:31: warning: implicit declaration of function 'smc_fopen'
gpmain.c:33: error: 'PNG_ERROR_CANTOPENFILE' undeclared (first use in this funct
ion)
gpmain.c:38: warning: implicit declaration of function 'smc_filesize'
gpmain.c:39: warning: implicit declaration of function 'malloc'
gpmain.c:40: warning: implicit declaration of function 'smc_fread'
gpmain.c:43: warning: implicit declaration of function 'smc_fclose'
gpmain.c:47: warning: implicit declaration of function 'free'
gpmain.c:48: error: 'PNG_ERROR_READSIZE' undeclared (first use in this function)
gpmain.c:53: warning: implicit declaration of function 'gp_canvasCreateFromPngBu
f'
gpmain.c: At top level:
gpmain.c:60: error: syntax error before '*' token
gpmain.c:60: warning: return type defaults to 'int'
gpmain.c:60: error: conflicting types for 'gp_canvasCreateFromPngBuf'
gpmain.c:53: error: previous implicit declaration of 'gp_canvasCreateFromPngBuf'
was here
gpmain.c: In function 'gp_canvasCreateFromPngBuf':
gpmain.c:73: error: 'tGP_canvas' undeclared (first use in this function)
gpmain.c:73: error: 'canvas' undeclared (first use in this function)
gpmain.c: In function 'exitClean':
gpmain.c:81: warning: implicit declaration of function 'gp_canvasFree'
gpmain.c: In function 'gp_canvasCreateFromPngBuf':
gpmain.c:88: error: too many arguments to function 'png_create_read_struct'
gpmain.c:98: error: too many arguments to function 'png_read_info'
gpmain.c:108: warning: implicit declaration of function 'gp_canvasCreate'
gpmain.c:108: error: 'GPC_BLACK' undeclared (first use in this function)
gpmain.c:117: error: too many arguments to function 'png_read_update_info'
gpmain.c:142: error: too many arguments to function 'png_read_image'
gpmain.c:156: warning: implicit declaration of function 'gp_colorRGB24to16'
gpmain.c:199: error: too many arguments to function 'png_read_end'
gpmain.c:77: warning: unused variable 'res'
gpmain.c:61: warning: unused variable 'header'
¿Que puedo hacer? ¿Hay alguna otra funcion para leer PNG?
Quizas el include de la libreria libpng lo tienes puesto despues de los includes de tu programa. A lo mejor poniendo el include de la libpng antes, puede que funcione.
Yo uso la libreria SDL_image tienes informacion aki http://www.libsdl.org/projects/SDL_image/
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.