Jump to content

  • Log In with Google      Sign In   
  • Create Account

GameCodingNinja

Member Since 18 Aug 2005
Offline Last Active Mar 30 2016 05:19 PM

Topics I've Started

Translate 2D mouse position to place an object in 3D space

19 February 2016 - 08:28 AM

I want to be able to click on the screen and place a box at that spot in perspective 3D space. I would need to give the box the offsets in world view. The camera is at 0,0,0. In addition to the screen coordinates where 0,0 is the center of the screen, I also know the z order of where I want to box to go. Say -150

 

I've been struggling with this problem for a day now and google searches are not helping. Thought I could solve it with simple tri which is all I'm good at.

 

Can anyone solve this?

 


NDK 10, std::packaged_task hoses build on an odd way

16 January 2016 - 11:41 AM

As a side note, std::future will not build on armeabi but will build on armeabi-v7a.

 

I'm trying to use std::packaged_task but it breaks my build in an odd way. My app will run on the phone but will lockup before it even gets near the code using the std::packaged_task. I can tell this because there is a graphic that will show before getting into the main game loop and if I put a delay as the first line in main, I'll never see the graphic. Even if I put a break point on the below code, it never get's hit.

 

Below is some example code that will cause the build to lock up before the code reached that point. Just the fact that the code is present somewhere seems to cause this problem.

 

std::packaged_task not ready for prime time on NDK 10?

void CMenu::DoTransform()
{
    if( m_visible )
    {
        // Test code
        auto task = [this] { this->Transform(); };
        std::packaged_task<void()> package( task );
        
        package();

        //Transform();

Need help understaning APP_ABI build options

14 January 2016 - 06:01 PM

As far as I know, the possible native build options in Application.mk are

APP_ABI := armeabi armeabi-v7a x86

 

Do you really need to build all three? Will one do for all Android phones?


Unable to view log info in LogCat with Android app

20 October 2015 - 11:35 AM

I'm trying to send log messages so that I can see the output in LogCat via Eclipse. I tried it with the Android and SDL call but nothing shows up in Log Cat. I set the filter to "verbos" or "debug" but none of the information is displayed.

 

Is there a trick to this or am I doing something wrong.

 

Had to apply a fix to Eclipse so that it would show all the LogCat tabs so I do see all the info.

void CStatCounter::IncCycle( SDL_Window * m_pWindow )
{
    // These counters are incremeented each game loop cycle so they can
    // be placed here in this function because this function is also called
    // each game loop cycle
    m_elapsedFPSCounter += CHighResTimer::Instance().GetFPS();

    ++m_cycleCounter;

    // update the stats every 500 miliseconds
    if( m_statsDisplayTimer.Expired(CTimer::RESTART_ON_EXPIRE) )
    {
        // Show the output
        #if defined(__ANDROID__)
    	__android_log_print(ANDROID_LOG_DEBUG, "Lap Cat Games", "%s", "Test Message");
        #else
        if( !CSettings::Instance().GetFullScreen() )
            SDL_SetWindowTitle( m_pWindow, GetStatString().c_str() );
        #endif

        // Now that the stats are displayed, we can reset out counters.
        ResetCounters();
    }

}   // HasCycleCompleted

or

void CStatCounter::IncCycle( SDL_Window * m_pWindow )
{
    // These counters are incremeented each game loop cycle so they can
    // be placed here in this function because this function is also called
    // each game loop cycle
    m_elapsedFPSCounter += CHighResTimer::Instance().GetFPS();

    ++m_cycleCounter;

    // update the stats every 500 miliseconds
    if( m_statsDisplayTimer.Expired(CTimer::RESTART_ON_EXPIRE) )
    {
        // Show the output
        #if defined(__IPHONEOS__) || defined(__ANDROID__)
        SDL_LogDebug( SDL_LOG_CATEGORY_RENDER, "%s", GetStatString().c_str() );
        #else
        if( !CSettings::Instance().GetFullScreen() )
            SDL_SetWindowTitle( m_pWindow, GetStatString().c_str() );
        #endif

        // Now that the stats are displayed, we can reset out counters.
        ResetCounters();
    }

}   // HasCycleCompleted

Stencil buffer not working on Android NDK implementation

19 October 2015 - 10:04 AM

Got my game engine to build and run on the Android over the week end. It also builds and runs on Windows and Linux.

 

Is there some extra step to get stencil buffering working? Same code works as expected on WIndows and Linux.


PARTNERS