Source.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)
{
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);
windowsp[window][mode[window]](red, blue, green);
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();
return 0;
}
void windows(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows11(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows12(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows13(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows14(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows21(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows22(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows23(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows24(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows31(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows32(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows33(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
void windows34(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]);
static void(*windowsp[][4])(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080])
= {
windows, windows, windows, windows,
windows11, windows12, windows13, windows14,
windows21, windows22, windows23, windows24,
windows31, windows32, windows33, windows34
};
#include"Ztaizen.h"
//今のところそれぞれの関数には適当なことを書いています
void windows(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window11(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window12(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window13(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window14(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window21(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window22(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window23(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window24(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window31(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window32(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window33(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
void window34(int red[4][1920][1080], int green[4][1920][1080], int blue[4][1920][1080]){
int x = 0, y = 0;
for (x = 0; x < 1920; x++)
{
for (y = 0; y < 1080; y++)
{
red[3][x][y] = 1;
blue[3][x][y] = 1;
green[3][x][y] = 1;
}
}
}
このようなコードを作ってみたところ、
エラー 23 error LNK2001: 外部シンボル ""void __cdecl windows34(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows34@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 24 error LNK2001: 外部シンボル ""void __cdecl windows34(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows34@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 21 error LNK2001: 外部シンボル ""void __cdecl windows33(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows33@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 22 error LNK2001: 外部シンボル ""void __cdecl windows33(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows33@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 19 error LNK2001: 外部シンボル ""void __cdecl windows32(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows32@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 20 error LNK2001: 外部シンボル ""void __cdecl windows32(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows32@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 17 error LNK2001: 外部シンボル ""void __cdecl windows31(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows31@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 18 error LNK2001: 外部シンボル ""void __cdecl windows31(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows31@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 15 error LNK2001: 外部シンボル ""void __cdecl windows24(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows24@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 16 error LNK2001: 外部シンボル ""void __cdecl windows24(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows24@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 13 error LNK2001: 外部シンボル ""void __cdecl windows23(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows23@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 14 error LNK2001: 外部シンボル ""void __cdecl windows23(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows23@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 11 error LNK2001: 外部シンボル ""void __cdecl windows22(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows22@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 12 error LNK2001: 外部シンボル ""void __cdecl windows22(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows22@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 9 error LNK2001: 外部シンボル ""void __cdecl windows21(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows21@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 10 error LNK2001: 外部シンボル ""void __cdecl windows21(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows21@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 7 error LNK2001: 外部シンボル ""void __cdecl windows14(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows14@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 8 error LNK2001: 外部シンボル ""void __cdecl windows14(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows14@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 5 error LNK2001: 外部シンボル ""void __cdecl windows13(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows13@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 6 error LNK2001: 外部シンボル ""void __cdecl windows13(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows13@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 3 error LNK2001: 外部シンボル ""void __cdecl windows12(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows12@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 4 error LNK2001: 外部シンボル ""void __cdecl windows12(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows12@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 1 error LNK2001: 外部シンボル ""void __cdecl windows11(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows11@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Source.obj Win32Project-test
エラー 2 error LNK2001: 外部シンボル ""void __cdecl windows11(int (* const)[1920][1080],int (* const)[1920][1080],int (* const)[1920][1080])" (?windows11@@YAXQAY1HIA@EDI@H00@Z)" は未解決です。 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Ztaizenc.obj Win32Project-test
エラー 25 error LNK1120: 12 件の未解決の外部参照 C:\Users\---\documents\visual studio 2013\Projects\Win32Project-test\Debug\Win32Project-test.exe Win32Project-test
という風にエラーがでました。
改善策を教えてくださればありがたいです。