このようなコードを書いてみたところ、
Sourse.cpp
#include "DxLib.h"
#include "Ztaizen.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
//宣言
int x, y;
int MouseX, MouseY;
int key;
int handle, grhandle;
int red[4][1920][1080];
int green[4][1920][1080];
int blue[4][1920][1080];
int window;
int mode[4] = { 0, 0, 0, 0 };
if (DxLib_Init() == -1) // DXライブラリ初期化処理
{
return -1; // エラーが起きたら直ちに終了
}
//設定
window = 0;
handle = MakeARGB8ColorSoftImage(1920, 1080);
SetDrawScreen(DX_SCREEN_BACK);
SetMouseDispFlag(TRUE);
//実行
while (ProcessMessage() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0){
ClearDrawScreen();
GetMousePoint(&MouseX, &MouseY);
windomode(window,mode[window],red,green,blue);
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
DrawPixelSoftImage(handle,x,y,red[window][x][y],green[window][x][y],blue[window][x][y],0);
}
}
grhandle = CreateGraphFromSoftImage(handle);
DeleteSoftImage(handle);
DrawGraph(0, 0, grhandle, TRUE);
key = GetJoypadInputState(DX_INPUT_KEY_PAD1);
if (CheckHitKey(KEY_INPUT_ESCAPE) == 1)
{
break;
}
if (CheckHitKey(KEY_INPUT_F1) == 1){
window = 1;
}
if (CheckHitKey(KEY_INPUT_F2) == 1){
window = 2;
}
if (CheckHitKey(KEY_INPUT_F3) == 1){
window = 3;
}
if (CheckHitKey(KEY_INPUT_BACK) == 1){
window = 0;
}
if (CheckHitKey(KEY_INPUT_LSHIFT) == 1){
if (mode[window]>=4){
mode[window] += 1;
}
else
{
mode[window] = 0;
}
}
ScreenFlip();
}
DxLib_End(); // DXライブラリ使用の終了処理
return 0; // ソフトの終了
}
#include"Ztaizen.h"
//関数の内容は適当です
static void window0(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window11(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window12(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window13(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window14(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window21(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window22(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window23(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window24(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window31(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window32(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window33(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void window34(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]){
int x, y;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
r[3][x][y] = 1;
b[3][x][y] = 1;
g[3][x][y] = 1;
}
}
}
static void(*windows[][4])(int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]) =
{
window0,window0,window0,window0,
window11,window12,window13,window14,
window21,window22,window23,window24,
window31,window32,window33,window34
};
void windomode(int w, int m, int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080])
{
windows[w][m](r, g, b);
}
void windomode(int w, int m, int r[4][1920][1080], int g[4][1920][1080], int b[4][1920][1080]);
というようなエラー(警告?)がでました。
改善案を教えてください!お願いします。