Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

104 Neutral

About shoez

  • Rank
  1. [color=#333333]I would very much like to learn some internet programming for windows in order to create a way to download files for my programs or even connect to another peer in a peer to peer chat application. Could anyone provide advice on the difference vs WinInet vs WinSock 2.0? and also what would be better to learn in your opinions?
  2. shoez

    Design Advice

    [font=Arial][size=2]I'm needing a bit of design advice on what class/class's would be appropriate to build for my current situation. [/font] [font=Arial][size=2]Currently I have a program that communicates with my php server, which in turn communicates with my database server to make SAFE/INJECTION safe queries. The following request need to be handled in my program 1.) Query database to check if user credentials are valid 2.) Check if user has latest version of application 3.) Check what software the user has purchased from us and use this information to display the list of purchases to the user so he can pick which one he would like to download 4.) Allow the user to request a password change keep in mind, Every query returned from the php server( which queries my database ) returns the database information in XML format. Therefore it will need to be parsed[/font] [font=Arial][size=2]Does anyone have any recommendations on the Class/Classes that would be appropriate to implement and recommended names for them? i was thinking just a class name CAuth. Any advice is greatly appreciated!![/font] [font=Arial][size=2]EDIT:[/font] [font=Arial][size=2][font="Arial"]Keep in mind that im wanting to keep this program modular and change out these classes i implement just in case the verification process changes( for example if i wanna just query the database only.....or maybe i want to make it where non XML formatted data gets returned). Pretty much if i decide i want to try a newer secure method i can swap classes out easily without breaking anything if not much![/font][/font]
  3. Just confirming the followin formula is the one I'm looking for. It was prodded by tsus. What I'm wanting to do it pass in window client area screen coordinates and have them transformed into projection space to be mapped to the screen within my d3d window using X [-1,1] y [-1,1] float2 screenToPostProjection(float2 screen, float2 ViewPort) { float2 normalizedScreen = float2( screen.x / ViewPort.x, screen.y / ViewPort.y); float2 postProjection = normalizedScreen * 2.0 - 1.0; // mapping from [0,1] to [-1,1] postProjection.y *= -1; // window origin is in different corner. return postProjection; } My Screen Coordinates Im Passing in are the following: top left vertex: ( 100, 300 ) top right vertex: ( 700, 300 ) bottom right vertex: ( 700, 800 ) bottom left vertex: ( 100, 800 ) Performing the above transformation on each vertex yields the following results: top left vertex: ( -.6875, -.25 ) top right vertex: ( 1.1875, -.25 ) bottom right vertex: ( 1.1875, -2.333 ) bottom left vertex: ( -.6875, -2.3333 ) something is not right some of the values above are outside of the [-1 - 1] range that they must be provided within
  4. I want to debug my shaders so i can see the value of each vertex after it has been transformed. Anyone have any recommendation on how i can achieve this?
  5. shoez

    deleting dynamic memory error

    the first line is called inside the constructor of my object and the deletion occurs inside the destructor of the object.
  6. m_pszConsoleTitle = new wchar_t[chCount]; How come when i allocate thove above memory...and then try and deallocate it using delete[] m_pszConsoleTitle; i obtain an assert error ?
  7. shoez

    #pragma for .lib

    yea tried them
  8. shoez

    #pragma for .lib

    Ims curious, is it even possible to specify a specific FOLDER location when using the following pragma? #pragma comment(lib, "C:\Folder\library.lib") ive tried every possible combination and cannot get it to work pretty much im wanting to link to a .lib located in a different folder
  9. Could anyone give a brief description of How i should view what an effect file what is the idea behind it? i know its more then just a place to HOUSE your shader code. Also what is the idea behind a technique as well? thanks
  10. shoez

    Problem Drawing Line

    I made the above changes and i'm still getting a blank window so no matter what orientation of space of vertices i pass into the vertex buffer they should come out in Projection Space?
  11. Everything Compiles fine but i cannot see the line on the screen any ideas on what im doing wrong? Pixel Shader All i want this to do is pass in my vertexs and color them //////////////////////////////////////////////////////////////////////////////// // Filename: //////////////////////////////////////////////////////////////////////////////// ////////////// // TYPEDEFS // ////////////// struct PixelInputType { float4 Position : SV_POSITION; float4 Color : COLOR; }; //////////////////////////////////////////////////////////////////////////////// // Pixel Shader //////////////////////////////////////////////////////////////////////////////// float4 PS_Main(PixelInputType input) : SV_TARGET { return input.Color; } Vertex Shader All i want this to do it pass in vertices thru without performing any special things to them struct VS_INPUT { float4 Pos : POSITION; float4 Color : COLOR; }; struct VS_OUTPUT { float4 Pos : SV_POSITION; float4 Color : COLOR; }; // Passing 3d coordinates // convert to projection VS_OUTPUT VS_Main( in VS_INPUT In ) { VS_OUTPUT Out; Out.Pos = In.Pos; Out.Color = In.Color; return Out; } Line initialization function void InitializeLine() { // Assume Function Failure bool bFunctionStatus = false; if (pDevice == NULL || pDeviceContext == NULL) return bFunctionStatus; m_pDevice = pDevice; m_pDeviceContext = pDeviceContext; // Create Vertex Buffer SVertex2 Vertex[] = { { D3DXVECTOR3(50.0f, 50.0f, 1.0f), D3DXCOLOR(0.5f, 0.5f, 0.5f, 0.5f) }, { D3DXVECTOR3(100.0f, 100.0f, 1.0f), D3DXCOLOR(0.5f, 0.5f, 0.5f, 0.5f) } }; // Create Description of buffer we are this case a vertex buffer D3D11_BUFFER_DESC vbd; vbd.ByteWidth = sizeof(SVertex2) * 2; vbd.Usage = D3D11_USAGE_DEFAULT; vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER; vbd.CPUAccessFlags = 0; vbd.MiscFlags = 0; /*vbd.StructureByteStride = ???*/ // Create Sub Resource so we can fill created buffer D3D11_SUBRESOURCE_DATA vInitData; vInitData.pSysMem = &Vertex; // Create the buffer now HRESULT hrErrorCode; hrErrorCode = m_pDevice->CreateBuffer(&vbd, &vInitData, &m_pVertexBuffer); if (hrErrorCode != S_OK) { OutputDebugString(L"ErrorCreating Vertex Buffer"); return bFunctionStatus; } ID3DBlob* vsBuffer = NULL; ID3DBlob* psBuffer = NULL; __try { // Compile Vertex Shader bool bOk = CompileD3DShader(L"VS_Shader.fx", "VS_Main", "vs_4_0", &vsBuffer); if( bOk == false ) { OutputDebugString( L"Error compiling the vertex shader!" ); __leave; } // Create Vertex Shader with Compiled Code HRESULT hrErrorCode; hrErrorCode = m_pDevice->CreateVertexShader(vsBuffer->GetBufferPointer(), vsBuffer->GetBufferSize(), 0, &m_pVSShader); if ( hrErrorCode != S_OK ) { OutputDebugString( L"Error creating the vertex shader!" ); __leave; } // Describe Layout for Custom Vertex structure of each element // Lets Describe Vertex Layout D3D11_INPUT_ELEMENT_DESC VertexDescription[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 } }; // Create InputLayout hrErrorCode = m_pDevice->CreateInputLayout(VertexDescription, 2,vsBuffer->GetBufferPointer(), vsBuffer->GetBufferSize(), &m_pInputLayout); if ( hrErrorCode != S_OK ) { OutputDebugString( L"Error Creating Input Layout!" ); __leave; } // Compile Pixel Shader bOk = CompileD3DShader(L"PS_Shader.fx", "PS_Main", "ps_4_0", &psBuffer); if ( bOk == false ) { OutputDebugString( L"Error compiling the vertex shader!" ); __leave; } // Create Pixel Shader with compiled bytecode hrErrorCode = m_pDevice->CreatePixelShader(psBuffer->GetBufferPointer(), psBuffer->GetBufferSize(), 0, &m_pPSShader); if ( bOk == false ) { OutputDebugString( L"Error Creating Pixel Shader!" ); __leave; } bFunctionStatus = true; } __finally { // Free Resources to prevent leak! if (vsBuffer) vsBuffer->Release(); if (psBuffer) psBuffer->Release(); } return(bFunctionStatus); } } void DrawLine() { // Clearing back buffer/render target here ...... UINT stride = sizeof(SVertex2); UINT offset = 0; // Setup pipeline // Input Assembler m_pDeviceContext->IASetInputLayout(m_pInputLayout); m_pDeviceContext->IASetVertexBuffers(0, 1, &m_pVertexBuffer, &stride, &offset); m_pDeviceContext->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_LINELIST); // Vertex Shader m_pDeviceContext->VSSetShader(m_pVSShader, NULL, NULL); // Pixel Shader m_pDeviceContext->PSSetShader(m_pPSShader, NULL, NULL ); // Draw m_pDeviceContext->Draw(2,0); // Calling Present Here ...... }
  12. If i pass a custom vertex structure into my vertex shader is it assumed to be in worldspace,model space,view space, or projection space? for example if i pass the following vertex structs into my vertex shader how do i know/assume what coordinate space they are currently in? struct SVertex { float x, y, z; int nColor; }; struct SVertex2 { float x, y; int nColor; };
  13. Why do examples specify the position as having 4 float values in the shader when in the code it is only using a 3 element vector? whats with this? struct SVertex { D3DXVECTOR3 position; D3DXVECTOR4 color; }; PS_Shader code //////////////////////////////////////////////////////////////////////////////// // Filename: //////////////////////////////////////////////////////////////////////////////// ////////////// // TYPEDEFS // ////////////// struct PixelInputType { float4 position : SV_POSITION; float4 color : COLOR; }; //////////////////////////////////////////////////////////////////////////////// // Pixel Shader //////////////////////////////////////////////////////////////////////////////// float4 PS_Main(PixelInputType input) : SV_TARGET { return input.color; }
  14. in directx 11 is is mandatory to code my own vertex and pixel shader? is there a way to use pre programmed shaders that are already created? for example im just wanting to draw a line on the i still have to define a vertex and pixel shader?
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!