Jump to content
  • Advertisement

AnthonyDivitto

Member
  • Content Count

    20
  • Joined

  • Last visited

Community Reputation

101 Neutral

About AnthonyDivitto

  • Rank
    Member
  1. AnthonyDivitto

    Game state management

    thank you for replying, do you think you could provide a small example of how you would implement a switch like you said?
  2. AnthonyDivitto

    Game state management

    Hello everyone, Recently in school a friend and i were discussing game states, and that interested me to do some research. I checked out the tutorial on msdn but unfortunatly i couldn't get it to run. The reason we were discussing game states is i was looking for a way to set up a menu for a space invaders clone i want to work on. I found another topic on the forum about states but it involved stacks and lists and was a lot more complicated then i think it needs to be. My original idea was using something like a switch statement to controll which state the game was currently in. So my question is, how would you design a method to control game states? My clone of space invaders would include a main menu, an options screen, a game screen and a high score screen. i would also like the game screen to be able to jump to a pause screen.
  3. AnthonyDivitto

    quick level editor question

    I know I need work with forms lol in my defence when I started this project it was all going to be done in xna but once I got started forms just seemed to be the better way to go. I deffinatly plan on getting some more practice in before I do anything serious with them.
  4. AnthonyDivitto

    quick level editor question

    unfortunately, i can't view the spriteFontControl.cs file because visual studio blocks it and gives you an error when you try to open it, but that's okay. i kind of see where you are going, I didn't realize that i needed to subclass Graphics device control, however after i transferred those three classes to my new project they don't work because it doesn't recognize the XNA using statements. Do i need to add them to the reference folder? how would i do this? sorry for re-posting! I figured all that out on my own. I think the only thing im missing is when my new program runs it doesn't look like there is an xna window on the winForm do i need to set it to be there in the designer? or do i need to initialize it somewhere
  5. AnthonyDivitto

    quick level editor question

    I've been looking over the winForm series 1 example thing and maybe this stuff is over my head but i don't really understand how it works at all. I understand that i need a windows form with an XNA window built into it. I also understand that i have to monitor the time which isn't a big deal since there is no animations in a level editor. I'll tackle content loading when i get there but can someone really break down what [post='this']http://create.msdn.com/en-US/education/catalog/sample/winforms_series_1[/post] is doing and how/why it is working? I know i could write my own version of it if i understood how it worked.. maybe I'm just thinking to hard.. lol
  6. AnthonyDivitto

    quick level editor question

    I see, i'm not really having problems as much as i just wasn't sure how to implement the game class with the microsoft example. Your last post has cleared up most of my questions about how the framework is built. So for now i don't have any more questions, but if i run into another problem i'll be sure to post it up here. Thank you for your help.
  7. AnthonyDivitto

    quick level editor question

    I actually found this sample, and was doing some research on it. ( why i stopped posting until now ) I'm sure i'm starting to sound like a total noob but from what i have read that sample doesn't allow use of the game class. I looked through the sample and i can't seem to understand how it works with out it. I wish there was better documentation or a set tutorial that came with it. I kept meaning to post this but forgot i have an xna project in a winForm using the example found here: http://royalexander.wordpress.com/2008/10/09/xna-30-and-winforms-the-easy-way/ It's basically a cheater way to get the same effect as the WinForm + XNA series you were talking about but it comes out sloppy and i dont like it. I would like to implement it the microsoft way because i know its been tested. So how would i implement the code i already have ( written using the Game1 and varies other classes ) to work with the winform series example? i hope that makes since...
  8. Didn't check my fb all day cause I knew it would get blown up with bday posts. Really made my day to see old friends I thought forgot about me posting on my wall thanks everyone! I suddenly feel all warm and fuzzy :P
  9. AnthonyDivitto

    quick level editor question

    I was thinking of using a windows form, but your custom graphicsDevice idea seems more interesting. could you explain what you mean by custom graphicsDevice? i am unaware of how you would do this. thanks for your response
  10. Hello everyone, i am still reasonably new to XNA so i decided to make a level editor for practice. I have a working editor but what i want to do is have a window that displays the tiles you can choose from like most other level editors have. Since I'm trying to learn the ins and outs of XNA i don't really want any code i can directly copy ( because I'm lazy and i will ). So my question is, what windows form would you use to display the tile sheet so that the user can select which tile he/she wants to draw with, and how would you go about using it. I hope this question is clear enough. -thanks for any responses.
  11. AnthonyDivitto

    Learning directX

    thank you for your response, i have tried books but not that one so i will deffinatly look into it and your right the tutorials in the sdk arent very good for a complete newbie to graphics how similar is 10 to 11? is it close enough i could learn the basics and be ok? is it any easier to learn 10 rather than 11 first? thx!
  12. AnthonyDivitto

    Learning directX

    Hey everyone, i have been trying to learn DirectX11 for a few weeks now and honestly i don't think i have learned much of anything... so my question is, how did you learn DirectX and what do you think is the best way? Any info would be great becuase i'm really having a rough time with this.
  13. AnthonyDivitto

    CompileD3DShader() failing

    Thank yoiu for replying, i tried to do what you said but the control panel only lets me change the settings on directX8 and 9 the tab for 10-11 is completly greyed out... did i miss something?
  14. AnthonyDivitto

    CompileD3DShader() failing

    Its not an error, the program runs but it stops when it checks if the vertex shader loaded correctly. The output window looks like this... Whats a PDB file? [font="Consolas"][size="1"][font="Consolas"][size="1"]'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\d3dx11_43.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded. 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Binary was not built with debug information. 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\wbload.dll', Binary was not built with debug information. 'direct3D blankWindow.exe': Loaded 'C:\Program Files (x86)\Stardock\MyColors\wblind.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\msimg32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Program Files (x86)\Stardock\MyColors\wbhelp.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Unloaded 'C:\Windows\SysWOW64\setupapi.dll' 'direct3D blankWindow.exe': Unloaded 'C:\Windows\SysWOW64\devobj.dll' 'direct3D blankWindow.exe': Unloaded 'C:\Windows\SysWOW64\cfgmgr32.dll' 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\igd10umd32.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\d3dx10_40.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Loaded 'C:\Windows\SysWOW64\D3D11SDKLayers.dll', Cannot find or open the PDB file 'direct3D blankWindow.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll' 'direct3D blankWindow.exe': Unloaded 'C:\Windows\SysWOW64\d3dx10_40.dll' The thread 'Win32 Thread' (0x101c) has exited with code -1 (0xffffffff). The thread 'Win32 Thread' (0x1e68) has exited with code -1 (0xffffffff). The thread 'Win32 Thread' (0xacc) has exited with code -1 (0xffffffff). The thread 'Win32 Thread' (0xc10) has exited with code -1 (0xffffffff). The thread 'Win32 Thread' (0x18ac) has exited with code -1 (0xffffffff). The program '[7808] direct3D blankWindow.exe: Native' has exited with code -1 (0xffffffff). [/font][/font]
  15. Im trying to do a version of the colored triangle on the screen tutorial. Im confident i have everything right, but my shader always fails to compile the only thing i can think of is the .fx file im using isn't working. I am not familiar with the .fx extension, ive done a lot of research and im still pretty lost with it.... anyways here is my function that is giving me the error hopefully you guys will find something i missed, bool Triangle::LoadContent() { ID3DBlob* vsBuffer = 0; bool compileResult = CompileD3DShader( "solidGreenColor.fx", "VS_Main", "vs_4_0", &vsBuffer ); if( compileResult == false ) { MessageBox( 0, (LPCWSTR) L"Error loading vertex shader!", (LPCWSTR) L"Compile Error", MB_OK ); return false; } HRESULT d3dResult = d3dDevice_->CreateVertexShader(vsBuffer->GetBufferPointer(),vsBuffer->GetBufferSize(), 0, &solidColorVS_); //create the vertex shader if(FAILED(d3dResult)) //if failed kill the app { if( vsBuffer ) vsBuffer->Release(); return false; } //create an array D3D11_INPUT_ELEMENT_DESC solidColorLayout[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0,0, D3D11_INPUT_PER_VERTEX_DATA, 0 } }; unsigned int totalLayoutElements = ARRAYSIZE(solidColorLayout); d3dResult = d3dDevice_->CreateInputLayout(solidColorLayout, totalLayoutElements, vsBuffer->GetBufferPointer(),vsBuffer->GetBufferSize(), &inputLayout_); //create the input layout vsBuffer->Release(); if(FAILED( d3dResult)) //kill app return false; ID3DBlob* psBuffer = 0; compileResult = CompileD3DShader("SolidGreenColor.fx", "PS_Main", "ps_4_0", &psBuffer ); //create shader if(compileResult == false) //kill app { MessageBox(0, (LPCWSTR) L"Error loading pixel shader", (LPCWSTR) L"compile error!", MB_OK ); return false; } d3dResult = d3dDevice_->CreatePixelShader(psBuffer->GetBufferPointer(), psBuffer->GetBufferSize(), 0, &solidColorPS_); //create the pixel shader psBuffer->Release(); //kill buffer if(FAILED(d3dResult)) //kill the app return false; //triangle vertices VertexPos vertices[] = { XMFLOAT3( 0.0f, 0.5f, 0.5f ), XMFLOAT3( 0.5f, -0.5f, 0.5f ), XMFLOAT3( -0.5f, -0.5f, 0.5f ) }; //vertex descriptor D3D11_BUFFER_DESC vertexDesc; ZeroMemory( &vertexDesc, sizeof(vertexDesc)); vertexDesc.Usage = D3D11_USAGE_DEFAULT; vertexDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexDesc.ByteWidth = sizeof( VertexPos ) * 3; D3D11_SUBRESOURCE_DATA resourceData; ZeroMemory( &resourceData, sizeof( resourceData)); //set amount of memory needed resourceData.pSysMem = vertices; d3dResult = d3dDevice_->CreateBuffer( &vertexDesc, &resourceData, &vertexBuffer_ ); if(FAILED(d3dResult)) //kill app return false; return true; } also here is my source for the compileD3Dshader methodbool D3D11BASE::CompileD3DShader( char* filePath, char* entry, char* shaderModel, ID3DBlob** buffer ) { DWORD shaderFlags = D3DCOMPILE_ENABLE_STRICTNESS; #if defined( DEBUG ) || defined( _DEBUG ) shaderFlags |= D3DCOMPILE_DEBUG; #endif ID3DBlob* errorBuffer = 0; HRESULT result; result = D3DX11CompileFromFile( (LPCTSTR)filePath, 0, 0, entry, shaderModel, shaderFlags, 0, 0, buffer, &errorBuffer, 0 ); if( FAILED( result ) ) { if( errorBuffer != 0 ) { OutputDebugStringA( ( char* )errorBuffer->GetBufferPointer( ) ); errorBuffer->Release( ); } return false; } if( errorBuffer != 0 ) errorBuffer->Release( ); return true; } thanks again for your help!
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!