|
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.
|
|
|
|
|
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'.
|
|
|
|
|
you just use the DirectX cap viewer to check the maximum texture size, MaxTextureWidth, MaxTextureHeight of [D3DCAPS9 Structure^], it should be some thing like 2048 X 2048, so the texture creation more than this dimension is ignored i think, so the total size is 10 * 2048 * 2048 *4 = 40 MB, not 260 MB (8192X8192). you just try a texture size of 1024x1024* 50 PNG = 200 MB.
You cannot create texture more than the max texture size in D3DCAPS9.
Hanan888 wrote: I've g_pSprite->Draw()
PS: use ID3DXSprite::Begin and end also otherwise every call to Draw() internally calls begin and end.
Hanan888 wrote: * but I noticed my system start to sweat after 100 draw() for render().
Do you mean CPU temperature and CPU usage goes high, if so you are rendering in a tight loop, reduce the framerate to the reasonable framerate.
|
|
|
|
|
Hanan888 wrote: I changed to D3DUSAGE_DYNAMIC
this also not needed in your case, simply put 0 (zero).
|
|
|
|
|
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() .
|
|
|
|
|
Hanan888 wrote:
I need to find out how to make D3DXCreateTextureFromFileEx() be equivalent to D3DXCreateTextureFromFile().
Which is documented inside D3DXCreateTextureFromFile() .
|
|
|
|
|
I have winodow and create dialog with createdialog() function.
all works fine.
But in same time I have to show DialogBox on the dialog.
and in this moment DialogBox can't take focus - it has no action on button click on it...can I do something with it?
|
|
|
|
|
Member 3825493 wrote: But in same time I have to show DialogBox on the dialog.
How are you creating this second dialog box?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
1) first Dialog - CreateDialog(...)
2) messageBox - MessageBox(...)
|
|
|
|
|
CreateDialog(hWnd,...) - child of main window
MessageBox(m_hWnd,..) - child of the Dialog
|
|
|
|
|
Which dialog can't get user input?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
I can't imagine what's going wrong.
What does the MessageBox() call code look like?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
MessageBox(m_hWnd,text,NULL,NULL);
|
|
|
|
|
Never mind the deleted reply - the default is MB_OK....
It really should work - MessageBox() has been around a long long time.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I don't now what to say - but even if I make another modless dialog child of my first - it can't take focus...something wrong, but I have no idea what..
|
|
|
|
|
Hello,
Do you know what it means logical units at the help (MSDN) of StretchBlt ?
I found problem to define to origin at this function...
Thanks!
|
|
|
|
|
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.
|
|
|
|
|
Hanan888 wrote: logical coordinates are pixels.
Only in MM_TEXT mode, see here[^]
Graham
Librarians rule, Ook!
|
|
|
|
|
TalSt wrote: Do you know what it means logical units at the help (MSDN) of StretchBlt ?
This[^] explains it
Graham
Librarians rule, Ook!
|
|
|
|
|
Do you want to print any thing?
|
|
|
|
|
Hello,
I want to draw a BYTE* array on the screen by creating a bitmap and use StrechBlt function.
The problem was that the origin point was not (top, left) but (bottom, left).
I thought that it may be the StrechBlt function but finally I found that the problem is the creation of the bitmap from the BYTE* array.
The fix is:
m_bitmapInfo.bmiHeader.biHeight = -m_nImageHeight; // top-down DIB
The height should be -.
// Populate bitmapinfo header
m_bitmapInfo.bmiHeader.biSize = m_nBitmapInfoSize;
m_bitmapInfo.bmiHeader.biWidth = m_nImageWidth;
m_bitmapInfo.bmiHeader.biHeight = -m_nImageHeight; // top-down DIB
m_bitmapInfo.bmiHeader.biPlanes = 1;
m_bitmapInfo.bmiHeader.biBitCount = BPP;
m_bitmapInfo.bmiHeader.biSizeImage = m_nImageSize;
m_bitmapInfo.bmiHeader.biCompression = BI_RGB;
m_bitmapInfo.bmiHeader.biClrImportant = 0;
m_bitmapInfo.bmiHeader.biClrUsed = 0;
m_bitmapInfo.bmiHeader.biXPelsPerMeter = 0;
m_bitmapInfo.bmiHeader.biYPelsPerMeter = 0;
Thanks for all!
|
|
|
|
|
Is there a reason for using braces if they are not part of a condition or loop? For example:
cameraCollection->Item(0, &camera);
{ //extra code...
}
In this example, will it make a difference if I take out the braces? if it does, why?
Also, I have a sample code with no braces in the for loops? I thought braces were required, but the code compiles and does what it is supposed to do.
Example:
for(int y=0; y<288; y++)
for(int x=0; x<353; x++)
brightnessSum+=frameBuffer[x+353*y];
modified on Monday, June 2, 2008 9:08 AM
|
|
|
|
|
I use them for "local" logical section in a function/method to keep variable close to what they do.
adding braces does not make a difference UNLESS you define a variable in the scope of the braces and either try to use it after or forgetting that you used it before, it can be confusing to you.
int myInt = 0;
{
int myint = 1;
}
cout << myInt;
This signature was proudly tested on animals.
|
|
|
|
|
Queeny wrote: In this example, will it make a difference if I take out the braces?
No. If you had any variables declared within the braces, they would go out of scope at the closing brace.
Queeny wrote: Also, I have a sample code with no braces in the for loops? I thought braces were required, but the code compiles and does what it is supposed to do.
for /while /if statements will use the next statement (i.e., single) if no braces are present. The following statements are equivalent:
for(int x=0; x<353; x++)
{
brightnessSum+=frameBuffer[x+353*y];
}
for(int x=0; x<353; x++)
brightnessSum+=frameBuffer[x+353*y];
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|