Jump to content

  • Log In with Google      Sign In   
  • Create Account


Endurion

Member Since 21 Feb 2002
Offline Last Active Today, 10:18 AM

#5150789 Visual Studio 2012 Command Line Building Woes

Posted by Endurion on 01 May 2014 - 01:15 PM

AFAIR for SDL 1.2 to link you also had to link a second library containing the hidden WinMain function.

 

e.g. SDL.lib and SDLmain.lib

 

 

Also, see here: http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet2010e/index.php




#5150689 Command Console Window

Posted by Endurion on 30 April 2014 - 11:04 PM

Usually they are not real HWNDs but simply self written in the game engine.

 

It's easier to completely control the layout if you do the drawing and behaviour yourself.

 

GDI does not really work well inside OpenGL or DirectX areas.




#5150090 VC is ok but Mingw crashes with libcurl

Posted by Endurion on 28 April 2014 - 05:44 AM

Usually that's in found in the start menu. It's a link to a batch file that sets up a few environment variables.

 

Look under "Visual Studio 2012" for "Visual Studio Tools". There should be two links to a command prompt, one for x86, one for x64.




#5147398 WM_INPUT with Arrow Keys Failing

Posted by Endurion on 16 April 2014 - 11:17 AM

Did you pass the message on to DefWindowProc? If you don't some states may not get updated as expected.

 

From MSDN on WM_INPUT:

 

The application must call DefWindowProc so the system can perform cleanup.




#5147174 Need help to draw cursor properly

Posted by Endurion on 15 April 2014 - 12:46 PM

This sounds like you need to get the cursor hotspot. Funnily you need to use GetIconInfo to retrieve that info.

 

 

Edit: Ninja'd




#5145851 blurry images

Posted by Endurion on 09 April 2014 - 11:17 PM

If you still want a border you can look into AdjustWindowRect(Ex). It calculates a window rect from the wanted client rect size and the windows (ex) styles of your window.




#5145571 blurry images

Posted by Endurion on 08 April 2014 - 11:48 PM

The keyword here is directly mapping texels to pixels. Looky here (http://msdn.microsoft.com/en-us/library/windows/desktop/bb219690(v=vs.85).aspx)

 

 

Another cause of unwanted blurring may be if the backbuffer size does not match up the used client area size of the window.




#5144909 Expression must have class type?

Posted by Endurion on 06 April 2014 - 11:10 PM

As BHXSpecter said, we need the exact message and the location in the code.

 

Usually this message appears if you use dot.member (something.member)  on a pointer or something that isn't either struct or class.




#5143833 SDL undeclared filename and apply_surface not working

Posted by Endurion on 01 April 2014 - 11:43 PM

To keep the window running you need to have a "main loop", a loop that keeps the program running. If you leave the main method your program ends. From the tutorial code it's this snippet:

 

bool quit = false;
//While the user hasn't quit
while( quit == false )
{
  //While there's events to handle
  while( SDL_PollEvent( &event ) )
  {
    //If the user has Xed out the window
    if( event.type == SDL_QUIT )
    {
      //Quit the program
      quit = true;
    }
  }
}



#5143621 SDL undeclared filename and apply_surface not working

Posted by Endurion on 31 March 2014 - 11:50 PM

Well, you seem to have simply copy/pasted a few lines of code out of the working tutorial code.

 

Your main issue right now seems to be to read errors properly.

 

1)

The filename. You pasted a few lines from a function, which had parameter as a function argument. Obviously that argument is not here, so you have to declare filename yourself above the location where you access it. The compiler simply doesn't know what "filename" is (Hint: In the tutorial code it's a std::string)

 

2)

apply_surface is the same. It's a function defined in the tutorial code. You only copied lines calling that function. The compiler obviously does not know the function.

Simple solution: Copy also the apply_surface function and paste it above the main function.




#5141273 Why does this work?(Class prototype?)

Posted by Endurion on 22 March 2014 - 12:52 PM

Note however forward declaration only works if the compiler doesn't need to know anything of the inner parts of that class. This means you can only forward declare pointers or references, not direct objects.




#5138903 0..99 or 0..100

Posted by Endurion on 14 March 2014 - 04:43 AM

Win32-API uses inclusive/exclusive. MSs rationale for this is mathematics.

 

If you want to double a rect you can simply multiply all four values by 2.




#5133500 deinstancing c-strings

Posted by Endurion on 22 February 2014 - 06:01 AM

Seriously, noone comes up with this?

 

enum Colors
{
  red = 0xffff0000,
  green = 0xff00ff00,
  blue = 0xff0000ff
};

 

You get the best of enums and you get rid of the if/else-code completely.




#5129910 how to create a menu like that?

Posted by Endurion on 08 February 2014 - 02:30 PM

The Tab control is available in raw win32. It provides the tabs and their looks. You do have to manage the changing of child pages yourself.

 

Simple setup here: http://winapi.freetechsecrets.com/win32/WIN32Creating_a_Tab_Control.htm

 

More complex wrapper: http://www.codeproject.com/Articles/14712/Win32-SDK-C-Tab-Control-Made-Easy




#5129240 Visual Studio Questions

Posted by Endurion on 06 February 2014 - 12:44 AM

Visual Studio can nicely be uninstalled, but you need to use the main setup for this. Do NOT try to uninstall it's dependencies on your own. It will take care to remove the installed dependencies fine.

 

I had VS 2003, VS 2008 and VS 2010 installed (in that order). Then I uninstalled VS 2003 without problems, with VS 2008 and VS 2010 still working fine.






PARTNERS