목록SDL (3)
발전하는 춘배
문제 3가지가 있었다. 해결해보자. 1. 바둑알 놓아지는 위치void Game::HandleEvent(const SDL_Event& e) { if (e.type == SDL_EVENT_MOUSE_BUTTON_DOWN) { int x = e.button.x; int y = e.button.y; int cellSize = 1200 / (BOARDSIZE + 1); int col = x / cellSize; int row = y / cellSize; if (row >= 0 && row = 0 && col 지금코드다. 계산해보면 cellSizesms 75 나온다. 격자상에서 boa..
일단 GPT한테 부탁해서 "오목"이라는 600*600픽셀 윈도우를 띄워달라고 해봤다.1편에서 떴던 오류가 또 뜨길래 구글링해봤더니https://stackoverflow.com/questions/79636679/sdl-init-fails-without-returning-an-error #include SDL_Init() fails without returning an error?When I try to execute this SDL3 program: // g++ -Wall -Ofast main.cpp -Iinclude -Iinclude/SDL3 -Linclude/SDL3 -lSDL3 -o build/program #define SDL_MAIN_HANDLED #include #include stackov..
요새 오목 재밌게 해서 오목만들기로했음.SDL로 GUI 구현해보는게 목표라서게임 로직 자체는 간단해야 흥미 안 떨어지고 완성할 듯 싶기도 해서 오목으로 정함. 일단 기본로직완성함. class User{private:public: unsigned int totalGameCount; unsigned int winGameCount; string nickname; User(string nickname); void AddWinGameCount(); ~User();};User::User(string _nickname){ nickname = _nickname; totalGameCount = winGameCount = 0;}void User::AddWinGameCount() ..
