Click here to Skip to main content
15,891,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
is possible to convert?

C++
struct sKeyState {
    bool bPressed;
    bool bReleased;
    bool bHeld;
};

int m_numKeys;
Uint8* m_keyOldState;
const Uint8* m_keyNewState;
bool m_mouseOldState[5];
bool m_mouseNewState[5];

owncopy(
    m_keyNewState,
    m_keyNewState + m_numKeys,
    m_keyOldState
);

owncopy(
    m_mouseNewState,
    m_mouseNewState + 5,
    m_mouseOldState
);

template<class InputIterator, class OutputIterator>
OutputIterator owncopy(InputIterator first, InputIterator last, OutputIterator result)
{
    while (first != last) {
        *result = *first;
        ++result; ++first;
    }
    return result;
}


What I have tried:

public struct sKeyState
{
public bool bPressed;
public bool bReleased;
public bool bHeld;
};


int m_numKeys;
uint[] m_keyOldState;
uint[] m_keyNewState;
bool[] m_mouseOldState = new bool[5];
bool[] m_mouseNewState = new bool[5];
Posted
Updated 18-Nov-18 9:51am

1 solution

You can try the free version of this Converter: C++ to C# Converter[^]
But be warned, these converters are not suited for complex applications !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900