Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TheNerd Tk421

I feel quite stupid asking this...

This topic is 5547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

...But how do i get a picture..backing up...i had made a blank windows app... i wanna know how i could add a background picture to it..heres the code: #include <windows.h> #define WIN32_LEAN_AND_MEAN #define WINDOWNAME "My soon to be game" HWND hWnd; LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); } int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpCmdLine, int Cmd) { MSG msg; WNDCLASS wClass; wClass.style =CS_HREDRAW|CS_VREDRAW; wClass.lpfnWndProc =WindowProcedure; wClass.cbClsExtra =0; wClass.cbWndExtra =0; wClass.hInstance =hInstance; wClass.hIcon =LoadIcon(hInstance,IDI_APPLICATION); wClass.hCursor =LoadCursor(NULL,IDC_ARROW); wClass.hbrBackground =(HBRUSH)(COLOR_WINDOW-2); wClass.lpszMenuName =NULL ; wClass.lpszClassName =WINDOWNAME; RegisterClass(&wClass); hWnd = CreateWindow(WINDOWNAME, WINDOWNAME, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInstance, NULL); if(hWnd==NULL) return FALSE; else { ShowWindow (hWnd, Cmd); UpdateWindow(hWnd); } while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage (&msg); } return msg.wParam; } .... i want to have an image instead of (HBRUSH)(COLOR_WINDOW-2).. i like blue.. but if i make a game.. it wont be fun as it is

Share this post


Link to post
Share on other sites
Advertisement
if you''re trying to makea game read up on directX. that is waht every one uses for graphics in games, not windows dialog boxes.....

Share this post


Link to post
Share on other sites
quote:
Original post by headshot
ya, but does opengl do 2d as well as 3d?


Ummm Yes! It's called an orthographic projection matrix. How do you think HUD's, GUI, Fonts, etc are made?

BTW:
>>that is waht every one uses for graphics in games<<
That is kinda of a broad statement isn't it? Look at the NeHe and NeXe forum topics and see which one is more "active." That alone tells me that not "everyone" is using Direct3D for graphics.

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"

[edited by - UltimaX on August 6, 2003 9:52:24 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by TheNerd Tk421
every time i even look at ne directX code.. its just ...it looks like it will take for ever like a while b4 i get close to learning most of it


Then try opengl and see if you like it''s style more.

Share this post


Link to post
Share on other sites
Yes, DX code can be a little difficult to understand at first. For example, I am not that great with DX, but I am pretty good with math, logic, and game ideas in general. So once I got over the hurdle of understanding DX, which did take a while, and I still have DX related problems here and there, I was finally able to start working on my engine and actually be productive in making computer games.

So what does this all mean? Well, if you want to learn DX to make games, be prepared for a long journey. Game programming takes a long time, and a lot of time out of your day. I personally believe we will see a rise of more powerful game engines/templates/creators in the near future to help eliminate some of learning time.

If you don''t care to learn DX, and just want to make games without learning the itty bitty parts of DX, then you may be better off getting a good engine and working with that.


--Vic--

The future of 2D game development:
Flat Red Ball

Share this post


Link to post
Share on other sites
I dont really want to jump in and make a game that does everything... i have troubles with creating basic basic basic text rpgs..i wanted to know how to get pictures on the screen of my comp..then i will go into it further.. i want to learn DX... but cant find any good tutorials... especialy ne that work with the compiler i have

Share this post


Link to post
Share on other sites
There were some good tutorials up at www.andypike.com, but the site has been taken down. I believe it''s still in google''s cache so you can do a search for it and view it that way . Now, if you want to stick to just windows programming for now, then head on over to www.gametutorials.com and look at their Win32 section. It will show you how to create an HDC for your bitmap and blit it to the screen. It''s quite simple once you get it working.

Oh yeah... Whoever thought everyone uses DirectX, maybe you haven''t heard of the Quake games...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!