loading .bin models from nitrodir
Posted: Tue May 06, 2014 3:45 pm
hi i have been trying to find a way to load this .bin model "basiccubeX64.bin with nitrodir.
(basically a .x model converted with n"ds model exporter" to .bin)
here is the source im attempting with.
#include <filesystem.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
(basically a .x model converted with n"ds model exporter" to .bin)
here is the source im attempting with.
im also using these includes.FILE *pFile; char * buffer; size_t dataInFile; long fileSize;
pFile = fopen("basiccubeX64.bin", "rb");
fseek(pFile, 0, SEEK_END);
fileSize = ftell(pFile);
rewind(pFile);
buffer = (char*)malloc(fileSize+1); //buffer = (char*) malloc (sizeof(char)*fileSize);
dataInFile = fread(buffer, 1, fileSize, pFile);
fclose(pFile); //free(buffer);
glPushMatrix();
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
get_glPolyFormats(); get_glMats();
glTranslatef(0,0,0); glRotateX(-90); glScalef(10,10,10);
glBindTexture( 0,house2tex64_texid); glCallList((u32*)dataInFile);
glPopMatrix(1);
#include <filesystem.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>