Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

Hanan888

@Hanan888
About
Posts
92
Topics
26
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • undo changes on table in database
    H Hanan888

    my application has the following procedure. a database of products (20,000 rows) exists. our client has 'import' feature where he imports an excel file. this is implemented by deleting all products table rows, then doing the import - which is a long thing since we programmatically performing calculations on the data. the obvious problem is if the 'import' action fails (IO stuff), they now have none/partial/curropt data in the products table. We wish that if the 'import' operation fails, the original data remains. this is ASP.NET application, written in C#, using SQL Server 2005 and using XSD which we created through the VS2005 design tools.

    C# csharp database asp-net sql-server design

  • SQL Server Reporting Services 2005 can not drillthrough if I'm not administrator
    H Hanan888

    I'm developing a reporting system with SQL Server Reporting Services 2005. I have created a user ("ru3") at my host server. Now, I want him to be just like administrator user, except he wont see one of the reports. But, when I click on a field to make a drillthrough report, I get 'rsAccessDenied'. "The permissions granted to user 'ru3' are insufficient for performing this operation. (rsAccessDenied) "

    Database database sql-server sysadmin

  • DirectSound : stop play when switching between windows in the same application
    H Hanan888

    I'm developing a game application, with multiple windows, in C++ on Win32. My sound needs is to play a few short sounds when some events happen, plus some background music in the main menu. The thing I need to do : stop play sounds of window1 when switching focus to window2 in my application. I CAN DO THIS PROGRAMMATICALLY, but I wonder if it's a built-in capability of the DirectSound API. Note: it does auto-mutes my app sounds when switching focus to another app, but doesn't when switching windows inside my app.

    C / C++ / MFC c++ game-dev json

  • Need a good sound API
    H Hanan888

    Thanks. I once looked at SDL documentation and I thought, using SDL is something that I might use to build the entire application, not to add functionality. Am I wrong ?

    C / C++ / MFC c++ game-dev json

  • Need a good sound API
    H Hanan888

    Thanks. Cool example, haven't still figured out if MCI is good for me. Have you had any experience using it ?

    C / C++ / MFC c++ game-dev json

  • Need a good sound API
    H Hanan888

    Thanks.

    Mark Salsbery wrote:

    XAudio2 is great/new but for XP SP2+ only if that's an issue

    Can you please be specific about that ?

    C / C++ / MFC c++ game-dev json

  • Need a good sound API
    H Hanan888

    Thanks. I had a taste of DirectSound. My problem with it, takes me too long to figure out if I should explicitly stop a playing sound when switching focus to another window in my application or if it's done automatically somehow. According to XAudio2 Overview [^] : "For Windows game developers, XAudio2 is the long-awaited replacement for DirectSound". I would glad to read any recommendations / cons.

    C / C++ / MFC c++ game-dev json

  • Need a good sound API
    H Hanan888

    I'm developing a game application, with multiple windows, in C++ on Win32. My sound needs is to play a few short sounds when some events happen, plus some background music in the main menu.

    C / C++ / MFC c++ game-dev json

  • D3DERR_OUTOFVIDEOMEMORY while D3DXCreateTextureFromFileEx()
    H Hanan888

    Hanan888 wrote:

    I need to find out how to make D3DXCreateTextureFromFileEx() be equivalent to D3DXCreateTextureFromFile().

    Which is documented inside D3DXCreateTextureFromFile(). :)

    C / C++ / MFC graphics game-dev performance announcement lounge

  • D3DERR_OUTOFVIDEOMEMORY while D3DXCreateTextureFromFileEx()
    H Hanan888

    Thanks. Changing to zero was behaving, as far as I could see, like in D3DUSAGE_DYNAMIC. I need to find out how to make D3DXCreateTextureFromFileEx() be equivalent to D3DXCreateTextureFromFile().

    C / C++ / MFC graphics game-dev performance announcement lounge

  • D3DERR_OUTOFVIDEOMEMORY while D3DXCreateTextureFromFileEx()
    H Hanan888

    Hanan888 wrote: Perhaps there are more things that worth checking for example if this creates any problem (error or performance) when drawing (m_pSprite->Draw()) which is the only thing I do with the textures.

    Hope this is of any interest to you :) * I've g_pSprite->Draw() on a 225X225 portion of the 2048X2048 texture, 10,000 times during my render(). First render() took 4-5 milisec, next ones 1-2 milisec. no error ever happened. * but I noticed my system start to sweat after 100 draw() for render(). which is great. * when offseting outside of original & surface level 0 source rectangle ( I mean wehre they are equal as in the 2048X2048 case) (ID3DXSprite::Draw(pTexture,RECT(4000,4225,4000,4225),..)) no error returned and some unrelated yet consistent pattern is shown (which was some khaki color). when doing this using the 8192X8192 some other unrelated pattern shown (that one was a little darker). And bottom line I must know the size that will show my images 'as is'.

    C / C++ / MFC graphics game-dev performance announcement lounge

  • D3DERR_OUTOFVIDEOMEMORY while D3DXCreateTextureFromFileEx()
    H Hanan888

    Hanan888 wrote:

    Perhaps there are more things that worth checking for example if this creates any problem (error or performance) when drawing (m_pSprite->Draw()) which is the only thing I do with the textures.

    Some interesting stuff: the 8192X8192 is probably scaled down to 2048X2048. This I suspect from checking the surface level 0 description. Also, from easy to see differences when drawing a portion of the texture. When changed the size of image to 2048X2048, the part drawn looked similar to the original file.

    C / C++ / MFC graphics game-dev performance announcement lounge

  • D3DERR_OUTOFVIDEOMEMORY while D3DXCreateTextureFromFileEx()
    H Hanan888

    Thank you. I made an experiment with calling D3DXCreateTextureFromFileEx() on 10 PNG images of size 8192X8192 and received no error code.

    Rajkumar R wrote:

    say if you load all the textures at once 50 * 32 * 32 * 4 + 50 * 64 * 64 * 4 + 200 * 256 * 256 * 4 = 50 MB, while reasonable video memory of GPU is 64 MB, 50 MB is huge size only for textures.

    This should be about 260 MB so it doesn't seem like actual GPU mem is a concrete limit on the texture memmory size. Perhaps there are more things that worth checking for example if this creates any problem (error or performance) when drawing (m_pSprite->Draw()) which is the only thing I do with the textures. Another thing is trying to load 290 of those giant textures (maybe 300 is some strange number of resources limit).

    Rajkumar R wrote:

    BTW, do you need this D3DUSAGE_RENDERTARGET flag, it is used if you want to render to texture.

    I changed to D3DUSAGE_DYNAMIC. Loading textures still stopped at the same image in the series (actually exactly 1 image less), BUT, some error relating to ID3DXFont (using `ID3DXFont::DrawText()` suddenly draw some wacky straight scribbles that resemble the actual text) that I had and had a reason to believe happened because of my "texture loading abuse" was fixed.

    C / C++ / MFC graphics game-dev performance announcement lounge

  • D3DERR_OUTOFVIDEOMEMORY while D3DXCreateTextureFromFileEx()
    H Hanan888

    thanks.

    C / C++ / MFC graphics game-dev performance announcement lounge

  • D3DERR_OUTOFVIDEOMEMORY while D3DXCreateTextureFromFileEx()
    H Hanan888

    this is what i'm doing:

    m_pD3D = Direct3DCreate9( D3D_SDK_VERSION )

    ...

    D3DPRESENT_PARAMETERS d3dpp;
    ZeroMemory( &d3dpp, sizeof(d3dpp) );
    d3dpp.Windowed = TRUE;
    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
    d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
    m_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
    D3DCREATE_SOFTWARE_VERTEXPROCESSING,
    &d3dpp, &m_pd3dDevice )

    ...

    D3DXCreateTextureFromFileEx(m_pd3dDevice, pSrcFile.c_str()
    ,D3DX_DEFAULT,
    D3DX_DEFAULT ,
    D3DX_DEFAULT,
    D3DUSAGE_RENDERTARGET,
    D3DFMT_A8R8G8B8,
    D3DPOOL_DEFAULT,
    D3DX_FILTER_NONE,D3DX_DEFAULT,0,NULL,NULL,
    &(pStatData->m_Texture)))

    after about 300 hundred textures from files it this returns D3DERR_OUTOFVIDEOMEMORY. sizes are: I check the height (which is rounded to power of 2) of the returned texture at surface level 0. first 100 textures of varying sizes, often small, 32 or 64 height on avergae. then 200 textures all with 256 height. I make sure to release() unused textures and directX resources and not making memory leaks in general. The answer can be: 1. I should set some flag to make this all work. 2. I should load big textures with multiple images in them. 3. I'm passing some hard limit and I must cut down in the size of image resources.

    C / C++ / MFC graphics game-dev performance announcement lounge

  • StretchBlt - logical units ?
    H Hanan888

    you better post the link :) I got the documentation about Windows GDI . Without knowing anything I guess origin (0,0) is the top left corner of the window, and logical coordinates are pixels.

    C / C++ / MFC help question

  • DirectX9 Surfaces Transparency
    H Hanan888

    Rajkumar R wrote:

    see, [IDirectDrawSurface::Blt^] and see the DDBLT_ALPHASRC flag.

    Are you sure this applies to the latest SDK? couldn't find it in any branch of the MSDN documentation tree.

    C / C++ / MFC question

  • DirectX9 Surfaces Transparency
    H Hanan888

    Thanks again for your help.

    Rajkumar R wrote:

    i was thinking on IDirectDrawSurface:Blt which supports that

    I don't think DirectDrawSurface support any alpha-blending. It support color-keying - setting a specific color not to be shown. Also, AFAIK DirectDrawSurface cannot be loaded from .PNG file. It seems I'm gonna use the sprite interface with textures. AFAIK, all textures must be power of 2 in size which will force me to alter the resource files. Also, with the many images I have, it's kinda slow and I'm looking for anything that speeds up the loading.

    C / C++ / MFC question

  • DirectX9 Surfaces Transparency
    H Hanan888

    Thank you.

    Rajkumar R wrote:

    have you seen "on a surface" to another surface. without enabling alpha blending state, you are not going to get transparency from Direct 3D, which doesnot do/skips any alpha blending calculation on the device.

    I think perhaps StretchRect() doesn't go through that processing. this is what I tried:

    pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE);
    pd3dDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR);
    pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCCOLOR);
    pd3dDevice->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO,&pBackBuf);
    pd3dDevice->StretchRect(sourceSurface, pSourceRect, pBackBuf,
    pRectOnBackbuffer,D3DTEXF_NONE);

    I use surfaces in the A8R8G8B8 format, load from PNG images with alpha-channels. saw no effect. This is how I create the source surfaces:

    device->CreateOffscreenPlainSurface(width,height, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
    &surface, NULL);

    Rajkumar R wrote:

    AFAIK, D3DxCreateSurfaceFromFile is not dx9 API, may be you are using some wrapper which creates a surface and uses D3DXLoadSurfaceFromFile API.

    Sorry for the typo, it's D3DXLoadSurfaceFromFile().

    C / C++ / MFC question

  • DirectX9 Surfaces Transparency
    H Hanan888

    from the above link: The alpha value of a color controls its transparency. Enabling alpha blending allows colors, materials, and textures on a surface to be blended with transparency onto another surface. In my game, I just need to draw .png images with alpha, the same size they are. I've got a lot of those for drawing a complicated animation. I've got about 650 images. I find the textures interface unsuitable, because of their creation cost, and the fact they don't natively looked exactly as the images. So, I'm using D3DxCreateSurfaceFromFile() and later ID3DDevice::StretchRect() to draw on the bacbuffer surface. It seems to me like the SetRenderState() capabilities do not apply to DirectX9 surfaces. But I do guess there is some way to alpha-blend surfaces because they contain alpha-channel color.

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups