|
In my code I use
#define CACHE_LINE 32<br />
#define CACHE_ALIGN __declspec( align(CACHE_LINE) )
to align a variable on the 32byte boundry so that it is AGP cache aligned (I'm writing a game at the mo.). Change the above to 16. Should work.
BTW, how is the Linux Kit for the PS2? Is it any good? I'm thinking of getting it but I'm currently too busy with Opengl to get a crack at the PS2.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Disclaimer: The following statement is not exactly true, but it's close enough for the purpose of this discussion.
#pragma pack only affects the packing of things larger than the specified size. Things smaller than the specified size are packed on their natural boundaries. For example, pragma pack(2) will cause ints, longs and __int64s to be packed on 2-byte boundaries, but won't affect the packing of chars (one-byte boundaries) or shorts (2-byte boundaries in any case).
Perhaps if you were to show us your structure, we'd be able to tell you why you are not getting the expected results.
Under the circumstances, you may want to use pragma pack(1) and put explicit padding in your structure.
|
|
|
|
|
Hello
This structure causes problems when the PFXVector3 struct is declared with __attribute__(align(16)) in gcc, even when VC++ is set to align on 16 byte boundries.
struct PFXVector3 {<br />
F32 x,y,z;<br />
};<br />
<br />
struct PFXEffectBaseData {<br />
U32 m_uiLifeTime;<br />
U32 m_uiAge;<br />
U32 m_uiFlags; <br />
CMatrix4 m_matrixRotate;<br />
PFXVector3 m_v3dGravity;<br />
PFXVector3 m_v3dPosition;<br />
};
U32 is just a typedef for unsigned 32 bit ints.
F32 is typedef for 32 bit single prec. fp.
CMatrix4 is the house matrix class.
To Brian:
>BTW, how is the Linux Kit for the PS2? Is it any good? I'm thinking of getting it but I'm
>currently too busy with Opengl to get a
>crack at the PS2.
I'm using SN Systems and a genuine Sony Dev Kit here at work. But sometimes I wish I was at home with a Linux Kit And doing OpenGL....sigh....
Thanks for all feedback again to everyone
- solosnake
|
|
|
|
|
1.
I've CEdit and a CButton on a CDialog. The CButton placed on top of the
CEdit. When the CButton is dragged up/down, I wish the CEdit will
streach/shrink, corresponding to the CButton bottom coordinate.
CAN SOMEONE LINK ME TO SOME ARTICLE THAT CAN RESOLVE MY ISSUE???
2.
An article dealing with HOWTO create non-cubical windows/controls (please?)
10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX a lot
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
Hi,
Can any one tell me the API's for database connection with SDK. Is there any article which explains this.
Kindly help.
|
|
|
|
|
I do not believe Windows SDK provides any database connection functionality. You will have to use the ODBC SDK at minimum or native drivers/tools provided by the DBMS vendor or newer connectivity tools likes ADO, OLE DB etc. I am assuming when you said SDK you meant Windows SDK.
|
|
|
|
|
Hi,
If you use Access, you can use CDao* classes.
hope it helps !
|
|
|
|
|
After having used CListCtrl::FindItem() to find the index of an item I want to mark the row with that index how do I do that?
I also committed the crime of posting a programming question in the Lounge.
|
|
|
|
|
To select item number i in list control use:
m_list_ctrl.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
To ensure that item number i is visible, use:
m_list_ctrl.EnsureVisible(i, FALSE);
If you want full row selection in list control:
m_list_ctrl.SetExtendedStyle ( LVS_EX_FULLROWSELECT );
|
|
|
|
|
Mark?
If you by "mark" mean "select" then use the SetCurSel(index) method
|
|
|
|
|
Argh! Ignore my previous post, too early in the morning...
|
|
|
|
|
Hi
Can someone explain PeekAndPump() function and why should we use it with a ProgressBar??
Is there a standard definition for this function???
|
|
|
|
|
Good link http://www.codeguru.com/controls/progress_wnd.shtml
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
The PeekAndPump function you're referring to is probably part of some example. There's no API or MFC function with this name.
Name of this function suggests that there's a loop inside which checks for messages with PeekMessage - hence the 'peek' part. If there's any message, it's dispatched to appropriate window; this is the reason for 'pump'. The peek'n'pump solution is needed because there's some activity going on and progress bar shows the progress of operation.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I am new to programming. I have been given the task of making an application that recieves commands via the serial port. and then displays a notification that the commands were recieved. I have been told that I need to use a thread to do this. I'm not sure where the thread goes, I.E does it go in the source file or the header file? Or do I declare it in the header file and then put the functionality in the OnInitialDialog function?
Thank you for any help.
Mavrock
|
|
|
|
|
Mavrock,
I have done something similar but nowhere near doing an article yet.
Basically:
1. Create a dialogue box
2. Insert the Mircosoft communications ActiveX component into it.
3. Create a variable name for the ActiveX component. This then creates a class for the MSCOMM component (prompt displayed).
4. Set the RThreshold property to 1. This causes an OnCommEvent for every character received.
5. In the OnCommEvent() procedure, event 2 is for soemthing received.
If you want a small sample project let me have your email address and I'll forward it.
I have used this on Win98 and NT4 with no problems.
Elaine (fluffy tigress emoticon)
Would you like to meet my teddy bear ?
|
|
|
|
|
Dear Elaine,
Thank you for the direction. If you don't mind I would really like to see your sample project. You can send it to me at stonematthies@hotmail.com.
thanks. Mavrock
|
|
|
|
|
On this site codeproject.com and on codeguru.com, you can find many articles about your topic
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
Hi there,
I just wanted to add new records to end of record list like this:
Gen
Brus Lee
Arnold
Hadi
and etc.
I wrote it:
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Gen");
m_rs.SetFieldValue("NAME", "Brus Lee");
m_rs.SetFieldValue("NAME", "Arnold");
m_rs.SetFieldValue("NAME", "Hadi");
m_rs.Update();
But when i run this code, the result is strange ...
the result is it:
Hadi
Arnold
Brus Lee
Gen
vice versa ???
But why ?
What's my wrong ?
Help me please !
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
why don't you ask this on Carlos's article ?
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Hello dear Chris,
I sent several mail to him before this, but unfortunatly he didn't answer to mails ...
But what do you think about my problem ? what's wrong ?
Thank you for reply
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi, It's 3 AM in Argentina... I will see that you say in the morning...
In a couple of Hours i need to
I don't know what happens but I didn't recive all the message. I saw your question here but I didn't recibe this question...
I make a question for you.
You tried with the following?
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Gen");
m_rs.Update();
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Brus Lee");
m_rs.Update();
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Arnold");
m_rs.Update();
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Hadi");
m_rs.Update();
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hello my frieeeeeeeeeeeeeeeend
nice to see you
You wroking hard
ok, about the question ...
No, i'll try this way and tell you the result ...
But what is the problem in my pervious code ??
i mean:
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Gen");
m_rs.SetFieldValue("NAME", "Brus Lee");
m_rs.SetFieldValue("NAME", "Arnold");
m_rs.SetFieldValue("NAME", "Hadi");
m_rs.Update();
But, let me test your way ...
Thanks
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello again Mr.Carlos,
If i tell you what was the problem you'll kill me
I did a kiddy wrong,
my wrong was for index on the field ...
Thanks.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Anyway, when you insert records in a DB, you should not rely on the insertion order to retreive the data later.
|
|
|
|