• Content count

  • Joined

  • Last visited

Community Reputation

158 Neutral

About superkent

  • Rank
  1. Hello, I am attempting to render a model of a snow globe that I downloaded. When I enabled AlphaBlend the globe portion of the snowglobe is a solid cornflower blue (the background color) and the internals of the globe arent visible. I assume the issue is the order in which I am rendering everything but I do not know how to sort the meshes in a model by transparency. Can someone point me in the right direction? I'm very new to all this.
  2. Hello, I am having some trouble linking to my dll. I have a class with a static member in the header file, and I initialize the member in a cpp file: TestClass.h class DLLExport TestClass { public: static const Type _type } TestClass.cpp Type TestClass::_type = Type(); When I try to compile my test application that references my DLL I get LNK2001: unresolved symbol on all of my static members.
  3. Cannot get Direct3D into fullscreen.

    I ended up having to set the BackBufferWidth and Height elements and it worked. Thank you for your help.
  4. Cannot get Direct3D into fullscreen.

    Thank you, I will give it a try and let you know.
  5. Hello All, I have been working on this thing for hours. I am trying to learn Direct3D, and for some reason my code stops working when I set the windowed element of the PresentParameters structure to false. I will paste the code below. Let me know if you need to see more. bool initDirect3D() { d3d9 = NULL; d3d_Device9 = NULL; if(NULL == (d3d9 = Direct3DCreate9(D3D_SDK_VERSION))) { MessageBox(NULL, "Could not create DX Class", "DX Failed", MB_OK | MB_ICONERROR); return false; } D3DPRESENT_PARAMETERS d3dpp; D3DDISPLAYMODE dmode; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = false; d3dpp.EnableAutoDepthStencil = false; d3dpp.hDeviceWindow = hwnd; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; d3dpp.BackBufferCount = 1; if(FAILED(d3d9->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &d3d_Device9 ))) { cleanUp(); MessageBox(NULL, "Failed while creating the device.", "DX Failed", MB_OK | MB_ICONERROR); return false; } return true; }
  6. code from my book

    I looked at your code in Dev-C++. It looks like you need to actually return the vector you are working with in your split function. When I did that it seemed to work. *Edit I dont get the error anymore, but you seem to still have a problem with your input stream. You dont need your getline in a while loop, it will grab the whole line until a new line if I remember right. added return ret; to the end of the function.
  7. Multi-Threading

    Unfortunatly my current project is not a game :( But I do need to know if anyone knows of any books or resources on multithreading. I know there are loads and loads of concepts and algorithms on multithreading out there but I just cannot seem to find a good reference. Specifically, my program will be multi-threaded with asynchonous network transfer, so I will also need some links and/or books to info on that. I will be developing in C#. Thanks in advance.
  8. Question about movement - Side scroller.

    Thanks Guys, I got it now. EasilyConfused, Thank you for your comment as this is my first game, right now I'm just creating a world. I do not have a character in it yet. I am making sure my engine that puts background elements and things on the screen is working properly. Eventually the viewport will be based on the position of the character, but the movement will be simular, just based on the position of the character as apposed to keyboard input. Thank you both for your input though, it has been most helpful
  9. Question about movement - Side scroller.

    Ok, so I did as you said, and it does indeed scroll smoothly, thank you very much. Yet this introduces another problem that I am stuck on. I cannot figure out a way to make it scroll faster or slower. If I push right, it moves well, yet if I press the run button, it still scrolls at the same speed just further, because weather or not Im moving 10px or 5 ahead, im still only incrmenting the viewer by one 1px 10 times or 5 times. Any Ideas on how I can move faster without loosing my smooth scroll?
  10. I am currently writing a side scroller (simular to Super Mario) using SDL. So far I was able to scroll back and forth and stop at each end. My problem is that the movement is not very smooth, it seems to "pulsate" for lack of better words. I will leave a snippet below. Please give me some advice as to how to accomplish a smooth scroll at different scolling speeds; walking and running for example. I repeat the process below for other input also, such as moving left. while(!killApp) //bool to flag the program as dead or alive. { SDL_PumpEvents(); //Poll for events. //Create a pointer to hold event array. Uint8 *keystate = SDL_GetKeyState(NULL); //Check if user is pressing right and d simultaneously (d will make the character "run") if(keystate[SDLK_RIGHT] && keystate[SDLK_d]) { //make sure we do not run out of surface. if(viewerXpos < 7600) { //Move the surface forward 10 pixels. viewerXpos += 10; } else { //If we are at the end, do not move the surface forward any more. viewerXpos = 7600; } } //Check if the user is pressing only right. else if(keystate[SDLK_RIGHT]) { //again, make sure we do not run out of surface. if(viewerXpos < 7600) { //move forward 5 pixels. viewerXpos += 5; } else { //otherwise stay where we are. viewerXpos = 7600; } } ... }
  11. structs and pointers

    Thanks! Im going to make my own, just for the experience, and I know I am going to have classes on linked lists in the future. Thanks again for the quick response!
  12. structs and pointers

    I have a noob question about structs. Is it possible to do the following in C++. struct myStruct { myStruct* next; myStruct* previous; } I am trying to make a queue that can be of variable length. If there is a better way to do this I would like to hear your opinion. Again im pretty new at C++ so all advise is greatly appreciated.
  13. SDL Question.

  14. SDL Question.

    Hello, Quick question about SDL. Off the bat Im sorry if this is a double post. I was going through Lazy Foo's SDL tutorials (props on them they are quit good!), and need to know what "-lmingw32 -lSDLmain -lSDL" means? I know it tells the linker where to find the SDL librarys etc, but Im one that has trouble doing something "because thats just how you do it." If anyone can tell me exactly what I am telling the linker that would be great! I want to know incase in the future I need to add to this line, I at least know what it is doing. Thanks.