Jump to content
  • Advertisement

Larry91

Member
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Larry91

  • Rank
    Member
  1. Hi! How can I create a program that can write the boot sector with C++! I have tried this: #include <sys/types.h> /* unistd.h needs this */ #include <unistd.h> /* contains read/write */ #include <fcntl.h> #include <stdio.h> #include <iostream> #include <fstream> using namespace std; int main() { char boot_buf[512]; int hdd_image, boot_image; /*boot_image = open("boot.img", O_RDONLY); read(boot_image, boot_buf, 510); close(boot_image);*/ fstream img("boot.img", ios::in | ios::binary); img.read((char*)boot_buf, 510); img.close(); boot_buf[510] = 0x55; boot_buf[511] = 0xaa; hdd_image = open("/dev/hd1", O_RDWR); if(hdd_image == -1) cout<<"Error!"<<endl; lseek(hdd_image, 512, SEEK_CUR); write(hdd_image, boot_buf, 512); close(hdd_image); } What's wrong? I have a virtual machine with a virtual driver Z: and I want to write its first sector (boot sector)! How can I do this? 10x a lot!
  2. Hi everybody! Will you tell me how can I create volumetric light, please?
  3. Larry91

    BootLoader

    I solved! It's working! How can I load from bootloader a file (.com) from the HDD?
  4. Hello everybody! I want to create an ASM bootloader that load my c++ OS that is located on the disk! Will you give me a simple tutorial, please? I prefer to write my OS in Microsoft VC++. I try this: ;------------------------------------------------------------ .286 ; CPU type ;------------------------------------------------------------ .model TINY ; memory of model ;---------------------- EXTERNS ----------------------------- extrn _BootMain:near ; prototype of C func ;------------------------------------------------------------ ;------------------------------------------------------------ .code org 07c00h ; for BootSector main: jmp short start ; go to main nop ;----------------------- CODE SEGMENT ----------------------- start: cli mov ax,cs ; Setup segment registers mov ds,ax ; Make DS correct mov es,ax ; Make ES correct mov ss,ax ; Make SS correct mov bp,7c00h mov sp,7c00h ; Setup a stack sti ; start the program call _BootMain ret END main ; End of program
  5. Larry91

    SoftShadows

    Some texture aren't rendered when I apply "Soft Shadows.fx" effect! Why? Take a look! http://www.freeuploadimages.org/images/y9zsstnypdy521mvgyq.jpg // Sample the color and normal maps float4 vColor = tex2D( ColorSampler, IN.vTexCoord );
  6. Hi! I implemented this shadows effect (http://www.gamedev.net/reference/articles/article2193.asp ), but when I try to execute this in my engine with alphatest and alphablend enable on the screen is render nothing. Will you tell me how to solve this problem? 10x!
  7. Hi! When I run this code I lost the device! What's the problem? I can render nothing! The screen is white and the window is fixed on the screen! CShadows::_CreationParams tcp; tcp.iWidth = 256; tcp.iHeight = 256; tcp.ColorFormat = D3DFMT_R32F; tcp.DepthFormat = D3DFMT_D24S8; . . . hr = D3DXCreateTexture( m_pD3DDevice, cp.iWidth, cp.iHeight, 1, D3DUSAGE_RENDERTARGET, cp.ColorFormat, D3DPOOL_DEFAULT, &m_pTexture ); if( FAILED( hr ) ) { MessageBox( NULL, TEXT( "Creating render texture failed!" ), TEXT( "Error!" ), MB_OK ); return false; } // Get its surface (used as render target) // hr = m_pTexture->GetSurfaceLevel( 0, &m_pSurface ); if( FAILED( hr ) ) { MessageBox( NULL, TEXT( "GetSurfaceLevel failed!" ), TEXT( "Error!" ), MB_OK ); return false; } // Create a depth stencil surface // hr = m_pD3DDevice->CreateDepthStencilSurface( cp.iWidth, cp.iHeight, cp.DepthFormat, D3DMULTISAMPLE_NONE, 0, TRUE, &m_pDSSurface, NULL ); if( FAILED( hr ) ) { MessageBox( NULL, TEXT( "CreateDepthStencilSurface failed!" ), TEXT( "Error!" ), MB_OK ); return false; }
  8. Larry91

    Setup!

    How can I make my game to work on another computer?
  9. Larry91

    Alpha channel

    I believe that I solved this pseudo problem! The true problem consist in alpha sorting, and I don't know how can I get details about meshes for discover if a mesh has alpha! LE1: How can I get alpha value from a texture? For materials I tested if diffuse.a is less than 1! LE2: I solved! 10x a lot guys! I forgot to set my texture format to ARGB! :P [Edited by - Larry91 on July 5, 2010 6:37:16 AM]
  10. Larry91

    Alpha channel

    Yes, but it's not working!
  11. Hello everybody! I have a problem with an alpha channel! The mesh that has a texture on the alpha channel is rendered without translucence! I wanna render a mesh water with an alpha texture! Here's my code: // Enable alpha testing m_pD3DDevice->SetRenderState( D3DRS_ALPHATESTENABLE, TRUE ); m_pD3DDevice->SetRenderState( D3DRS_ALPHAREF, (DWORD)0x000000A0 ); m_pD3DDevice->SetRenderState( D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); m_pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); //m_pD3DDevice->SetRenderState( D3DRS_ALPHATESTENABLE, false ); m_pD3DDevice->SetRenderState( D3DRS_SRCBLEND , D3DBLEND_SRCALPHA ); m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE ); // Set up sampler states. m_pD3DDevice->SetSamplerState( 0, D3DSAMP_MINFILTER , m_MinFilter ); m_pD3DDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER , m_MagFilter ); m_pD3DDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER , m_MipFilter ); m_pD3DDevice->SetSamplerState( 0, D3DSAMP_MAXANISOTROPY, m_Anisotropy ); // Set texture / addressing / color ops m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP , D3DTOP_MODULATE ); m_pD3DDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0 );
  12. Hi! How can I apply a pathfinding algorithm on a 3d map? LE: Should to create a 2d map from 3d? [Edited by - Larry91 on June 3, 2010 11:07:18 AM]
  13. Larry91

    Alpha rendering

    10x! It's work finely with 0x00000001! I had 0x000000A0.
  14. Hi! When I put m_pD3DDevice->SetRenderState( D3DRS_ALPHATESTENABLE, TRUE ), and m_pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ) my semitransparent objects are didn't rendere, but if I set m_pD3DDevice->SetRenderState( D3DRS_ALPHATESTENABLE, FALSE ), the objects are rendered corectly! It's a problem in my engine or this is the result if both are enabled?
  15. Larry91

    Angle between 2 vectors

    Ok! Thanks a lot!
  • 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!