ilda_dll.zip/ilda_test2.cpp
#include "ilda.h"
#include <stdio.h>
#include "DxLib.h"
ILDA_HANDLE handle;
#define POINT_COUNT (750)
int Draw(unsigned int frame_number) {
struct ILDAPoint *start_ptr;
unsigned int point_num_size;
ILDA_ERROR_ID error = GetPointData2(handle, frame_number, 1, POINT_COUNT, &start_ptr, &point_num_size);
if(error || point_num_size != 1) {
return 1;
}
unsigned int x = 128;
unsigned int y = 128;
for(unsigned int j = 0; j < POINT_COUNT; j++) {
if(start_ptr->blanking != TRUE) {
DrawLine(x, y, start_ptr->x, 255-start_ptr->y, GetColor(255, 255, 255));
}
x = start_ptr->x;
y = 255-start_ptr->y;
start_ptr++;
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
//ウィンドウモード
ChangeWindowMode(TRUE);
//画面のちらつき防止
SetDrawScreen(DX_SCREEN_BACK);
//ログ出力をしない
SetOutApplicationLogValidFlag(FALSE);
DxLib_Init();
handle = ILDAOpenHandle("badapple.ild");
if(handle == ILDA_INVALID_HANDLE) {
return 1;
}
unsigned int frame = 0;
while(ProcessMessage() != -1) {
ClearDrawScreen();
if(Draw(frame)) {
break;
}
ScreenFlip();
frame++;
}
ILDACloseHandle(handle);
DxLib_End();
return 0;
}