Jump to content

  • Log In with Google      Sign In   
  • Create Account

Endurion

Member Since 21 Feb 2002
Offline Last Active Yesterday, 11:49 PM

#5298076 Suggested patterns for declaring and detecting event triggers?

Posted by Endurion on 26 June 2016 - 01:13 AM

Wouldn't simple event handlers in Lua suffice? They could be simple functions (per map probably) that are called if the backend raises an event:

 

function ButtonPushed( ButtonName )
  -- do something
end
 
function TriggerAreaEntered( AreaName )
  -- do something else
end



#5297944 Including from the Standard C++ Library

Posted by Endurion on 24 June 2016 - 11:44 PM

Templates are a major reason. As pretty much all compilers can't separate template declaration from definition all code is inside the header file.

 

All these cmath, string, etc. are still regular headers, just without extension. At least VS automatically adds references to the C++ runtime libs, so all you need to do is to include the headers. The libs are imported "under the hood".




#5297175 VS2015 skipped reading glew.h file

Posted by Endurion on 18 June 2016 - 11:23 PM

You've got precompiled headers active. Turn it off in the options or include the glew headers in stdafx.h.




#5294583 WinAPI + OpenGL: Change window style and/or resolution

Posted by Endurion on 01 June 2016 - 11:37 PM

MSDN on SetWindowLong states:

Specifically, if you change any of the frame styles, you must call SetWindowPos with the SWP_FRAMECHANGED flag for the cache to be updated properly.




#5285965 Input Polling - Low Latency API

Posted by Endurion on 09 April 2016 - 01:25 AM

Nobody mentioned the Raw Input API? That's what you ought to use for Windows nowadays. It's a bit complicated to set up, but you're not missing any key presses or controller events.




#5285730 My app cannot write files anywhere on Windows 10

Posted by Endurion on 08 April 2016 - 12:40 AM

So, have you actually checked the error code (GetLastError) after a create/write fails? This would be a real good indication on what exactly the issue is.

 

You might think it's an issue with access rights and it could be a wrong path or similar.




#5277482 Free painter program with transperent color

Posted by Endurion on 22 February 2016 - 01:18 PM

Paint.NET is also a decent free tool (http://www.getpaint.net/download.html)




#5272443 Desktop capturing with DirectX 11

Posted by Endurion on 24 January 2016 - 02:01 AM

The problem I think is that you can't simply access the desktop backbuffer (there might not even be one -> classic theme) from DirectX. You best bet is probably using GDI. It's not that performant, but you only need to grab it once:

 

Look at http://stackoverflow.com/questions/5069104/fastest-method-of-screen-capturing, the GID way.




#5263770 loop: for(....) {... continue loop; ....} doesn't work

Posted by Endurion on 27 November 2015 - 01:01 AM

Seriously, stop hammering the Post button if it doesn't work right away.

 

This looks like Java. So the problem probably is the string comparison with the literal. Use this:

 

if ( ze.getName().equals( "_rels/.rels" ) ) continue loop;




#5257858 Problems writing a BMP exporter

Posted by Endurion on 19 October 2015 - 01:21 AM

To add on on the upside down:

 

If you store height as negative the bitmap data is top down instead.

 

Also, for iFileSize you must use the size calculated with scanline size as Gl2eenDl2agon described.




#5255876 What's the best system on which to learn ASM?

Posted by Endurion on 06 October 2015 - 01:29 PM

I'd target the machine you actually want to target :)

 

Obviously I'm biased for the C64, there's documentation abundant and there's no problem getting decent cross compilation tools.

 

<SelfAd>I recommend C64-Studio, my Visual Studio like IDE, which uses (Win)VICE for a neat debugging experience.</SelfAd>




#5254017 sprite render is very slow

Posted by Endurion on 25 September 2015 - 11:30 AM

As BitMaster said, make the PeekMessage check a while. Process all messages from a queue or you have extremely delayed window behaviour (dragging your window should lag like hell). It's not solving the main problem, but could be the cause of a few others.

 

while ( PeekMessage( &message, NULL, 0, 0, PM_REMOVE ) ) 
{ 
  TranslateMessage( &message ); 
  DispatchMessage( &message ); 
}



#5251826 Cursor Position slowly becoming less pixel perfect when moving from origin

Posted by Endurion on 11 September 2015 - 11:57 PM

Did you take in account the window border size? The size you pass to CreateWindow(Ex) is the outer size.

 

You can use AdjustWindowRect(Ex) to calculate the outer size from a wanted client size.




#5248693 Visual Studio 2013 raw string support missing

Posted by Endurion on 24 August 2015 - 11:42 PM

From the MSDN site you seem to have to add brackets inside the quotes:

 

std::string test = R"(\hello)";




#5244129 default install folder for windows game

Posted by Endurion on 02 August 2015 - 04:48 AM

You might try the guest account (or a samey common other user account) for testing. Install the game, run the game under the other account (via Shift-right click, run as...) and see if it works.

 

A bit annoying to debug this way, but doesn't require changing logged in user.






PARTNERS