Smarkus

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

141 Neutral

About Smarkus

  • Rank
    Newbie

Personal Information

  • Interests
    Art
    Design
    DevOps
    Education
    Production
    Programming
    QA

Recent Profile Visitors

448 profile views
  1. Okay, But what if I don't get in it?
  2. Hey guys, I'm halfway through my third year at a Game School in Tokyo. My job hunting process starts soon. The way job hunting works here is everyone makes a project/game/tool(game related) and then present it to the game studios/game companies. Here's a few things that I wanted to ask: What kind of a game could I make that'd be a solid one and get me hired? I want to showcase good C++ knowledge and Direct X(which they teach us at school) Specifically, what features should my game have that could come across as valuable? What are they looking for in fresh graduates? What game features are the industry people looking for? What could I make that'd impress them? I'd really appreciate your advice/comments/answers
  3. Oh awesome! It works now, thank you so much!
  4. Not sure if this is the problem, the book has the same code for device as mine. Is there anything that could possibly be wrong?
  5. //page 120 #include <Windows.h> #include <windef.h> #include <winuser.h> #include <d3d9.h> #include <d3dx9.h> #include <stdio.h> #include <stdlib.h> #include <time.h> //#pragma comment (lib,"d3d9.lib") //library's link //#pragma comment (lib,"d3dx9.lib") //#pragma comment (lib,"dxguid.lib") //#pragma comment (lib,"winmm.lib") //システム時刻取得に必要 | マルチメディアライブラリ(Windows Multimedia Library) //#pragma comment (lib,"dinput8.lib") #define APPTITLE "CreateSurface" #define KEY_DOWN(vk_code)((GetAsyncKeyState(vk_code)&0x8000)?1:0) #define KEY_UP(vk_code)((GetAsyncKeyState(vk_code)&0x8000)?1:0) #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 //function prototypes LRESULT WINAPI WinProc(HWND, UINT, WPARAM, LPARAM); ATOM MyRegisterClass(HINSTANCE); int GameInit(HWND); void GameRun(HWND); void GameEnd(HWND); //Direct3D Objects LPDIRECT3D9 d3d = NULL; LPDIRECT3DDEVICE9 d3ddev = NULL; LPDIRECT3DSURFACE9 surface = NULL; LPDIRECT3DSURFACE9 backbuffer = NULL; LRESULT WINAPI WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_QUIT: GameEnd(hWnd); PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); } //helper function to set up windows properties ATOM MyRegisterClass(HINSTANCE hInstance) { // create struucture WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); //fill the structure with information wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC)WinProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = NULL; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = APPTITLE; wc.hIconSm = NULL; //set up the window with the class info return RegisterClassEx(&wc); } //Entry point for a windows program int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; MyRegisterClass(hInstance); HWND hWnd; hWnd = CreateWindow( APPTITLE, APPTITLE, WS_EX_TOPMOST | WS_VISIBLE | WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL ); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); if (!GameInit(hWnd)) { return 0; } //Main Message loop int done = 0; while (!done) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) { done = 1; } TranslateMessage(&msg); DispatchMessage(&msg); } else { GameRun(hWnd); } } return msg.wParam; } int GameInit(HWND hwnd) { HRESULT result; //initialize Direct3D d3d = Direct3DCreate9(D3D_SDK_VERSION); if (d3d == NULL) { MessageBox(hwnd, "Error initializing Direct3D", "Error", MB_OK); return 0; } //set Direct3D presentation parameters D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; d3dpp.BackBufferCount = 1; d3dpp.BackBufferWidth = SCREEN_WIDTH; d3dpp.BackBufferHeight = SCREEN_HEIGHT; d3dpp.hDeviceWindow = hwnd; //create Direct3D device d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev); if (d3ddev = NULL) { MessageBox(hwnd, "Error creating Direct3D device", "Error", MB_OK); return 0; } //set random number seed srand(time(NULL)); //Clear the backbuffer to black d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); //Create pointer to back buffer d3ddev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); //create surface result = d3ddev->CreateOffscreenPlainSurface( 100, 100, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &surface, NULL); if (result!=D3D_OK) { return 1; } //load surface from file result = D3DXLoadSurfaceFromFile( surface, NULL, NULL, "char.jpg", NULL, D3DX_DEFAULT, 0, NULL); //make sure file was loaded fine if (result != D3D_OK) { return 1; } //draw surface to back buffer d3ddev->StretchRect(surface, NULL, backbuffer, NULL, D3DTEXF_NONE); //return okay return 1; } void GameRun(HWND hwnd) { RECT rect; int r, g, b; if (d3ddev == NULL) { return; } if (d3ddev->BeginScene()) { //Create pointer to the back buffer d3ddev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); //draw surface to the back buffer d3ddev->StretchRect(surface, NULL, backbuffer, NULL, D3DTEXF_NONE); //stop rendering d3ddev->EndScene(); } d3ddev->Present(NULL, NULL, NULL, NULL); //check for escape key to exit program if (KEY_DOWN(VK_ESCAPE)) { PostMessage(hwnd, WM_DESTROY, 0, 0); } } void GameEnd(HWND hwnd) { //free the surface surface->Release(); if (d3ddev != NULL) { d3ddev->Release(); } if (d3d != NULL) { d3d->Release(); } } So this is the code. I'm following a book and I checked If I made any mistakes. The picture shows what the error is. Can someone help? Also, what is the default location for a file/bitmap/jpg in my case?
  6. I've actually already ordered this book: https://www.amazon.com/Introduction-Programming-DirectX-Computer-Science/dp/1942270062 So, I was just trying to get my hands dirty and get ready to study the book. I mean I can't really switch now that I've already ordered the book. Also, I'm in Japan and some how the Amazon site here said that i'll get the book that I ordered the next day, whereas if I ordered the same book by the same author, just the DirectX 11 version, it'd take 2 to 3 months to ship. So I had no choice. But I'd appreciate if you told me some links or resources that explain how I set it up.
  7. I've tried looking for tutorials but nothing's really helping. Can anyone help?
  8. #include <Windows.h> #include <windef.h> #include <winuser.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #define APPTITLE "Game Loop" //function prototypes LRESULT CALLBACK WinProc(HWND, UINT, WPARAM, LPARAM); ATOM MyRegisterClass(HINSTANCE); BOOL InitInstance(HINSTANCE, int); void DrawBitmap(HDC, char*, int, int); void GameInit(); void GameRun(); void GameEnd(); //Local Variables HWND globalHwnd; HDC globalHdc; //Event callback function LRESULT CALLBACK WinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { globalHwnd = hWnd; globalHdc = GetDC(hWnd); switch (message) { case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hWnd, message, wParam, lParam); } //helper function to set up windows properties ATOM MyRegisterClass(HINSTANCE hInstance) { // create struucture WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); //fill the structure with information wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC)WinProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = NULL; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = APPTITLE; wc.hIconSm = NULL; //set up the window with the class info return RegisterClassEx(&wc); } BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; //create New window hWnd = CreateWindow( APPTITLE, APPTITLE, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 1080, 720, NULL, NULL, hInstance, NULL); //if error if (!hWnd) return FALSE; //display the window ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } //Entry point for a windows program int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int done = 0; MSG msg; MyRegisterClass(hInstance); if (!InitInstance(hInstance, nCmdShow)) { return FALSE; } GameInit(); // main message loop while (!done) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { //look for quit message if (msg.message == WM_QUIT) { done = 1; } TranslateMessage(&msg); DispatchMessage(&msg); } //process the Gameloop GameRun(); } //cleanup GameEnd(); return msg.wParam; } void GameInit() { //Initialize the game //load bitmaps, mesh, textures, sounds etc //initialize the random number generator srand(time(NULL)); } void GameRun() { //this is called once every frame //don't include yourn own loop here int x = 0, y = 0; RECT rect; GetClientRect(globalHwnd, &rect); if (rect.right > 0) { x = rand() % (rect.right - rect.left); y = rand() % (rect.bottom - rect.top); DrawBitmap(globalHdc, "c.bmp", x, y); } } void GameEnd() { } void DrawBitmap(HDC hdcDest, char *filename, int x, int y) { HBITMAP image; BITMAP bm; HDC hdcMem; image = LoadImage(0, "c.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); GetObject(image, sizeof(BITMAP), &bm); hdcMem = CreateCompatibleDC(globalHdc); SelectObject(hdcMem, image); BitBlt( globalHdc, x, y, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY); DeleteDC(hdcMem); DeleteObject((HBITMAP)image); }   I Just wrote this code practicing game loops and basically copied everything the reference book said but there's a red underline on the equals sign and the errors are as follows. Can somebody help?
  9. Need some help with this Visula Studio error

    What's wrong with it though?  
  10. #include <Windows.h> #include <stdlib.h> #include <time.h> #define APPTITLE "Hello World!" //function prototypes BOOL InitInstance(HINSTANCE, int); ATOM MyRegisterClass(HINSTANCE); LRESULT CALLBACK WinProc(HWND, UINT, WPARAM, LPARAM); //Event callback function LRESULT CALLBACK WinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC hdc; char *szHello = "Hello World!"; RECT rt; int x, y, n; COLORREF c; switch (message) { case WM_PAINT: //get dimensions of the window GetClientRect(hWnd, &rt); //start drawing on device hdc = BeginPaint(hWnd, &ps); //drawText DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER); //draw 1000 random pixels for (n = 0; n < 3000; n++) { x = rand() % (rt.left - rt.right); y = rand() % (rt.bottom - rt.top); c = RGB(rand() % 256, rand() % 256, rand() % 256); SetPixel(hdc, x, y, c); } //stopdrawing EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hWnd, message, wParam, lParam); } //helper function to set up windows properties ATOM MyRegisterclass(HINSTANCE hInstance) { // create struucture WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); //fill the structure with information wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC)WinProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = NULL; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = APPTITLE; wc.hIconSm = NULL; //set up the window with the class info return RegisterClassEx(&wc); } BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; //create New window hWnd = CreateWindow( APPTITLE, APPTITLE, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 400, NULL, NULL, hInstance, NULL); //if error if (!hWnd) return FALSE; //display the window ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } //Entry point for a windows program int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; MyRegisterClass(hInstance); if (!InitInstance(hInstance, nCmdShow)) { return FALSE; } //set random number seed srand(time(NULL)); // main message loop while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; }   I have some linker errors here, can someone help me out?
  11. I can't edit it out. It seems like you can't delete it. I added it following a youtube video but now i'm stuck
  12. Thanks for replying. Can you tell me how I can delete a library that I added by mistake which it turns out isnt an actual library so It's kind of showing me an error?    
  13. How much do i need to know to join the team?