|
I edited it after reading to make it more easy to understand.
I have seen that the old video card is not very good improving the performance of the CPU.
|
|
|
|
|
I used angle arc to divide circle into 8 segments, when i extend an angle of one angle arc then the other dissappears , it does not overwrites what to do?
What I have tried:
i used the below code
MoveToEx(hMemDC,50,50 , (LPPOINT) NULL);
AngleArc(hMemDC, 50 , 50 , 47, 0, 45);
SetArcDirection(m_hMemDC, AD_CLOCKWISE);
LineTo(hMemDC,50,50);
EndPath(hMemDC);
StrokeAndFillPath(hMemDC);
then
MoveToEx(hMemDC,50,50 , (LPPOINT) NULL);
AngleArc(hMemDC, 50 , 50 , 47, 45, 45);
SetArcDirection(m_hMemDC, AD_CLOCKWISE);
LineTo(hMemDC,50,50);
EndPath(hMemDC);
StrokeAndFillPath(hMemDC);
and so on..
now if i want to increase the angle of 2nd segment to 55 degrees then the 3rd segment dissappears. how to solve it ?
|
|
|
|
|
You should decide where to ask this question...Re-posting here (after the QA) will not gain you any advantage, but maybe some who thing you are annoying them...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Hi, Good day everyone.
l have some difficulties in the following which l need some help. Am a learner in win32 programming.
l created an application with a button "LogOut", which l want, when the user clicks the LogOut button, the application starts afresh. Just like in a standard program(eg. MSWORD) where when "New" is clicked, a new workspace pops out. So l need help in making my program to start afresh when LogOut button is clicked.
MY TRIAL:
l had done the following, and it worked but it only run the codes in WM_CREATE and l still had sent messages to other cases like WM_PAINT, WM_NOTIFY etc, still only the code in WM_CREATE runs.
case IDC_LOGOUTBTN:
SendMessage(hWnd,WM_CREATE, 0,(LPARAM)lpcs)break;
At some point in my program, l generate random numbers using srand((unsigned)time(&t)) and rand() functions when NEXT button is clicked. But l want to know if there is anyway to get the previous random number(s) when PREVIOUS button is clicked?
Thanks.
modified 30-Mar-16 3:27am.
|
|
|
|
|
Member 12139442 wrote: Just like in a standard program(eg. MSWORD) where when "New" is clicked, a new workspace pops out. Word simply creates a new document. It does not start over.
Member 12139442 wrote: So l need help in making my program to start afresh when LogOut button is clicked. I would consider ShellExecute() or CreateProcess() for this.
Member 12139442 wrote: But l want to know if there is anyway to get the previous random number(s) when PREVIOUS button is clicked? Store them in a container (e.g., array).
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
I have a problem when i have being composed a compiler program for my processor. A system operation( windows, linux ...), how can it run on another processor AMD or Intel? While AMD processors and Intel processors have instructions set different. Can someone answer my question?
|
|
|
|
|
Every compiler has options to specify the target processor type and version (the supported commands). If such options are not used, the compilers will generate code that can run on all Intel and AMD CPUs limited to a minimum processor generation depending on the compiler and version.
For GCC see i386 and x86-64 Options - Using the GNU Compiler Collection (GCC)[^].
For Visual C/C++ there is only one option: /arch (x86)[^].
|
|
|
|
|
Thank you very much! Jochen Arndt,
Regarding GPU, I know that, graphic module in a program can be run by CPU. Also, I know that GPU's instruction set of ATI (or Nvidia) and CPU's instruction set (Intel, AMD) are different. Is it that, insider a operation system has be exiting a dynamic compiler or a normal compiler compile a program to all machine architecture targets?
Newest Ubuntu 64 bits have about 1GB size. If it was compiled to specify one machine architecture, Its size would be smaller ? And how many about size?
Regards!
|
|
|
|
|
GPU's are complete different. They are accessed by operation system dependant drivers for normal operation. While it is possible to perform calculations on modern GPU's, these use their own compilers (e.g. The LLVM Compiler Infrastructure Project[^]).
Intel and AMD have basically the same instruction set. The same applies to other x86 based CPUs (VIA, Cyrix). There are only a very few manufacturer specific instructions. Compilers will not use these instructions by default and might even not provide options to use them. But even then compiling for a specific manufacturer would result only in marginal decreased code size. See also Differences between AMD64 and Intel 64 at x86-64 - Wikipedia, the free encyclopedia[^]
The code size can be slightly decreased (together with slightly increased performance) when generating code for newer processor generations. This is mainly achieved by enabling Streaming SIMD Extensions - Wikipedia, the free encyclopedia[^] for older processors and Advanced Vector Extensions - Wikipedia, the free encyclopedia[^] and the FMA instruction set - Wikipedia, the free encyclopedia[^] for newer ones.
Operating system distributions should run on all systems matching the minimum requirements. Therefore, they are usually build to support also older CPU's. However, they (and also applications) may detect the CPU and use modern instructions when supported. While this increases the code size it will also increase performance.
I can't tell you how much the size decreases when compiling a Linux kernel for a more recent CPU. If you really want to know it, you have to do it.
But reducing the code size should be not necessary nowadays where systems have a lot of storage (RAM and drives).
|
|
|
|
|
Hi Jochen Arndt,
I am trying to develop a processor ( you can think it is a IP ). It will be a IP module beside ARM core and the other IPs into a SoC ( example Snapdragon 820 etc... ). My processor can't running a program which were compiled for ARM architecture. And it only can run one program at a time. It was used to boost up the speed of a program when user need. The ISA for my processor is difference ARM's ISA. I want to make a driver/compiler for my IP, which can compile machine code of a program for the ARM core to machine code for my processor. Have you ever seem a driver/compiler like that? And It has ability to do?
Thank for your responds!
|
|
|
|
|
I have not seen such a compiler (which does not mean they do not exist). But the behaviour of a "driver" is similar to an emulator or the virtual execution system for intermediate languages like CIL used with .Net languages.
|
|
|
|
|
|
Hi Jochen Arndt,
Actually, I want to invite you for my project( processor that i am trying to make compiler/driver for it ). I will send project's material for you so that you clearly understand.
Are you ok ?
Regards!
|
|
|
|
|
Thank you for your invitation. But I have not enough free time to be engaged in such a project.
|
|
|
|
|
I have a problem when i have being composed a compiler program for my processor. A system operation( windows, linux ...), how can it run on another processor AMD or Intel? While AMD processors and Intel processors have instructions set different. Can someone answer my question?
|
|
|
|
|
With MFCm I am trying to create an OpenGL control on a split form the uses the splitter class to create the panes. My problem is I don't know where to put the OnInitDialog() function or how to wire it up. I have a main form CMainFrame and 2 child forms CFormRight and CFormLeft but don't see any place for the OnInitDialog function. The OnCreateClient function in MainForm calls m_splitter.CreateView but not OnInitDialog.
Any Suggestions?
John C
|
|
|
|
|
What does OnInitDialog have to do with this, where is the dialog in the above application?
|
|
|
|
|
You seem to need the OnInitialUpdate overrides for your left and right CView derived classes.
|
|
|
|
|
Victor,
Thanks so much but I still don't know what to do. my CForm right and CFormLeft (where I want to put the OpenGL window) inherit from CFormView. Where do put the over ride? I have CMainForm : public CFrameWnd, and COpenGL: public CWnd. The OnCreateClient() function in CmainForm creates the splitter
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this, 1, 2)){
return FALSE;
}
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CFormLeft), CSize(300, 100), pContext) ||
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CFormRight), CSize(100, 100), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
Thanks.
John
|
|
|
|
|
See my previous response. Where is the dialog?
|
|
|
|
|
Richard,
The function that I am trying to get to execute is COpenGLControl::oglInitialize() which was called in OnInitDialog in the example template I am following. the oglInitialize function, listed below should setup the OpenGL context. But my case is somewhat different as you can see from my most recent post and I don't know where to place the call to oglInitalize()
void COpenGLControl::oglInitialize()
{
static PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
16,
0, 0, 0, 0, 0, 0, 0,
};
hdc = GetDC()->m_hDC;
m_nPixelFormat = ChoosePixelFormat(hdc, &pfd);
SetPixelFormat(hdc, m_nPixelFormat, &pfd);
hrc = wglCreateContext(hdc);
wglMakeCurrent(hdc, hrc);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClearDepth(1.0f);
glFrontFace(GL_CCW);
glCullFace(GL_BACK);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
OnDraw(NULL);
}
In that example template I have three classes CMFCOpenGLDlg : public CDialogEx COpenGLControl : public CWnd and CMFCOpenGLApp : public CWinApp in this example the CMFCOpenGLDlg::OnInitDialog() function calls COpenGLControl::oglCreate() and COpenGLControl::OnCreate() calls COpenGLControl::oglInitialize() but I just don't see how to wire this up in my splitt form example where the panes are created from the splitter class.
Thanks,
John
...
// Create OpenGL Control window
m_oglWindow.oglCreate(rect, this);
|
|
|
|
|
OK, but you are not calling this from a dialog, but from a CView, so you probably need to call the initializer from the CView::OnInitialUpdate[^] function.
|
|
|
|
|
Richard,
Thanks for bearing with me. I looked in MDN and found this comment about OnInitialUpdate
Called by the framework after the view is first attached to the document, but before the view is initially displayed. So I assume that OnInitalUpdate is called automaticaly and I don't need to do anything to invoke it but where would I put the override code in CFormRight : public CFormView or COpenGLControl : public CWnd ?
Thanks again,
John
|
|
|
|
|
Member 12282738 wrote: CFormRight Yes.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|