For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I`m trying to build a barebones MFC app. I`m used to C# Forms, but I`m having a tough time in MFC though.
I`m creating a new MFC app in the New Project dialog and in the Wizard I pick Dialog based app as app type. However after creation I can`t open the resource (in the resource view) to fill it with controls.
it`s a totally fresh project, no edits after pressing the `Finish` button in the create app wizard/dialog. I`m expecting to be able to add new controls from ToolBox but obviously something is missing...
I do not think MFC apps make use of the Toolbox. If you double-click the resource file (projectname.rc) in Solution Explorer, it should open the Resource Editor where you can add the various controls to your dialog.
I am a hobbyist developer and I am recycling myself with the intention of learning C++ and D3D11. To give you an idea, I have been using for more than a decade a D3D9 engine with a programming language very similar to C. After doing several D3D11 tutorials, I think I understand fairly well where the shots are going.
The thing is that these tutorials lack an architecture designed to be scaled and they all end up in a function that does everything at once. Reading around, I have found a small explanation of how to combine in a simple way all the buffers that have to be associated to the pipeline to end up drawing on the screen, but I can't make it work.
The system is based on a class called 'Bindable' that contains a virtual function to associate the buffers to the pipeline and that is configured to be 'friendly' to the class that initializes the graphics (Graphics) to be able to access its private members.
I expand this class for each type of buffer with its specific constructor and dinder. For example, the mesh index buffer, which contains a pointer to the buffer and the number of indexes, looks like this:
As a test method, I create instances of the 'Bindable' heir classes and save their index in order to associate their buffers in subsequent frames. All in the same function, by the moment.
if (m_ibufIndex < 0)
m_ibufIndex = AddBind(std::make_unique<IndexBuffer>(*this, _indices));
This way, I intend to be able to associate all the buffers for each actor in the scene by means of a list of indexes and thus also be able to reuse the same buffers in different actors, although I haven't written this part yet, as I have found that the buffers are not associated to the pipeline correctly. When I call 'ID3D11DeviceContext::DrawIndexed' I get a warning that says the following:
ID3D11DeviceContext::DrawIndexed: An Index Buffer is expected, but none is bound. This is OK, as reading from a missing Index Buffer is defined to return 0. However the developer probably did not intend to make use of this behavior.
The thing is that the code compiles without problems and I have been able to verify, with the invaluable help of ImGui, that the instances of 'Bindable' are certainly created and that the buffers exist. For this purpose, I have added a member to the 'IndexBuffer' class that returns the description of the buffer and that I check right after the 'Bindable' creation/association block and it certainly exists.
I have tried to reinterpret the pointers hosted in 'm_binds' to their corresponding class, although I am pretty sure that it is not necessary.
You should really check the return values when creating buffers - you might find the graphics card doesn't want to create a 16-bit buffer or something annoying like that. Direct3D11 will happily run though a load of code that does nothing because something at the start wasn't set up properly.
I would step through in the debugger and check that everything is being assigned, and especially that the index buffer is being set to a real value and not nullptr.
I actually do check all the returns, I just squeezed down the code to the minimum. Even I check the data from gdiplus.h, that's where the warning come from. Every D3D11 function call is wrapped into an exception thrower.
I already have a straight function where the buffers are created and released every frame that works. I am trying to replace all those creations, step by step, by preloaded buffers, but with no luck.
To be clearer, I am trying to sustitute index and vertex buffers creations by the corresponding classes from a function that already draws a rotating cube. The mesh description is the very same.
I wanna implement an algorithm for Facial Recognition in C++ with the help of Viola-Jones, aka Adaboost, but without using OpenCV or any other similar library. I wanna do it all from scratch. Any tips?
Everybody gives me ambiguous answers.
P.S.: I started the whole thing by creating a RGB to grayscale Bitmap conversion.
I`m doing something wrong. In a right triangle the hypotenuse length is 80.62 the triangle side length opposing the angle is 40. The windows calculator result for inverse sin 40/80.6225 is 29.74 When I do the math with asinf() I`m getting 0.519