Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nbd

Pages: [1]
1
Graphics / Re: How to draw a single pixel?
« on: March 25, 2014, 05:11:43 pm »
Thanks for the responses. I'll try to use a vertex array.

2
Graphics / Re: How to draw a single pixel?
« on: March 25, 2014, 04:38:23 pm »
What exactly are you trying to achieve?

Yes, you can use a vertex array of points.
Otherwise you could use a rectangle shape with size 1x1 or a sprite.

Depending on what you want to do, you might want to look into shaders.

And if you want to edit pixels, you could think about using an sf::Image or your own vector of sf::Uint8. ;)

I want to draw a circle sector (arc). Is there a convenient way to do it with SFML without drawing individual pixels? In other thread for this task a Thor library was recommended:

http://en.sfml-dev.org/forums/index.php?topic=5609.msg36676#msg36676

3
Graphics / How to draw a single pixel?
« on: March 25, 2014, 04:07:37 pm »
Is there a simple way to draw a single pixel with SFML API? Something like SetPixel() in Windows GDI API?

There is a four-year old thread on this forum where addition of such a function were considered useful:

http://en.sfml-dev.org/forums/index.php?topic=1008.msg6426#msg6426

4
Graphics / Re: How to copy a part of an image?
« on: March 18, 2014, 04:10:23 pm »
Thankx! (I read documentation about Image, but looked only to constructors since I thought that if there is way to copy a part of an image, it would be logical to have a constructor with such an option. )

5
Graphics / How to copy a part of an image?
« on: March 18, 2014, 03:46:45 pm »
Is there a way to initialize an image (sf::Image or sf::Texture ) with only a portion (region) of other image? Say, one have a source 1000x1000 image and a destination 100x100 image. Is there a way to copy into the destination image a 100x100 region of the source image with specified coordinates?

6
General / Re: CMake doesn't work for VS 2013
« on: March 11, 2014, 10:33:02 pm »
zsbzsb,

yes, it's possible and all my projects compile just fine. But the fresh installation of VS 2013 on 64-bit Windows has some issues with the paths to Windows SDK:

http://stackoverflow.com/questions/3599079/windowssdkdir-is-not-set-correctly-in-visual-studio-2010

For my projects I just specified the SDK path in the VS Directories. But the CMake apparently doesn't check the internal VS configuration files and checks either some environment variable or some registry key. (The registry keys mentioned in the link above ( on stackoverflow.com ) are present on my system and contain correct paths.)

7
General / Re: CMake doesn't work for VS 2013
« on: March 11, 2014, 10:11:27 pm »
What happens if you tell CMake to use the default compiler toolchain (i.e. don't specify cl.exe or any other file)?

With default compiler toolchain I get six or seven error messages in the CMake GUI about unrecognized compilers and unsupported architecture. In the CMake output log file the first error message is the following:

Quote
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: 
Build flags:
Id flags:

The output was:
1
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.18408]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 3/12/2014 11:58:08 PM.
Project "L:\prg\libsrc\SFML\SFML-2.1_build_Debug\CMakeFiles\2.8.12.2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
E:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(355,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [L:\prg\libsrc\SFML\SFML-2.1_build_Debug\CMakeFiles\2.8.12.2\CompilerIdC\CompilerIdC.vcxproj]
  Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  E:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /nologo /W0 /WX- /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TC /analyze- /errorReport:queue CMakeCCompilerId.c
  CMakeCCompilerId.c
Link:
  E:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [L:\prg\libsrc\SFML\SFML-2.1_build_Debug\CMakeFiles\2.8.12.2\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "L:\prg\libsrc\SFML\SFML-2.1_build_Debug\CMakeFiles\2.8.12.2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.

Build FAILED.

I guess it is needed to set some environment variable specifying the path to kernel32.lib. The PATH variable contains that path, but it doesn't help. Maybe it's some variable related to the Windows SDK path.

8
General / Re: CMake doesn't work for VS 2013
« on: March 11, 2014, 09:22:58 pm »
zsbzsb

I have a totally fresh installation of Windows and VS (both are installed yesterday) and I don't have even any antivirus or third party firewall software intalled. All the exe files in the CMake/bin directory have the "Run as administrator" flag set and I tried to ran CMake with UAC turned off. The result is the same. :(

The CMake version is the latest one for Windows found on the CMake site: cmake-2.8.12.2-win32-x86

9
General / Re: CMake doesn't work for VS 2013
« on: March 11, 2014, 09:06:44 pm »
Mario

Yes, I'm using the Express edition. The message that kernel32.lib is not found happens if I choose the option in the CMake GUI "Specify the native compilers" and specify the cl.exe.

If I don't change or specify any settings and call CMake with default settings, then I get the messages that

Quote
The C compiler identification is unknown

and

Quote
The CXX compiler identification is unknown

The CMake log file gives the following details:

Quote
Build started 3/12/2014 11:21:17 PM.
Project "L:\prg\libsrc\SFML\SFML-2.1_build_Debug\CMakeFiles\2.8.12.2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
L:\prg\libsrc\SFML\SFML-2.1_build_Debug\CMakeFiles\2.8.12.2\CompilerIdC\CompilerIdC.vcxproj(14,3): error MSB4019: The imported project "L:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Also among the CMake's error message there is a message that the "architecture is not supported":

Quote
CMake Error: Internal CMake error, TryCompile configure of cmake failed
Check size of void* - failed
CMake Error at cmake/Config.cmake:13 (message):
  Unsupported architecture

I checked the Config.cmake in the SFML directory and the line 13 is in the following block:

    check_type_size(void* SIZEOF_VOID_PTR)
    if("${SIZEOF_VOID_PTR}" STREQUAL "4")
        set(ARCH_32BITS 1)
    elseif("${SIZEOF_VOID_PTR}" STREQUAL "8")
        set(ARCH_64BITS 1)
    else()
        message(FATAL_ERROR "Unsupported architecture")
        return()
    endif()

It seems that when CMake checks the size of the 'void' pointer, this size is not equal to 4 or 8 bytes. How this can happen? (I'm using the x64 Windows 7 on 32-bit Intel processor machine. )

10
General / CMake doesn't work for VS 2013
« on: March 11, 2014, 07:42:24 pm »
I'm trying to create a VS 2013 project with CMake, following this instruction:

http://www.sfml-dev.org/tutorials/2.1/compile-with-cmake.php

but keep getting the error message that

Quote
  The C compiler "E:/Program Files (x86)/Microsoft Visual Studio
  12.0/VC/bin/cl.exe" is not able to compile a simple test program.

The error that compiler (more precisely - linker) gives is:

Quote
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

I added the path to the 'kernel32.lib' file to the PATH variable from the command line with the commands

Quote
set PATH = %PATH%;  E:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A

and

Quote
set PATH = %PATH%;  E:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib

But keep receiving the same error. Do I need to specify somewhere the path to the 'kernel32.lib'?

11
General / Re: Rendering without RenderWindow
« on: February 26, 2014, 10:33:35 pm »
I have a "general purpose" test application where I test rendering not only using SFML and wanted to render in this application's window without creating a separate SFML window. But I see that it's probably easier to draw in a separate window. Thanks for the reply.

12
General / Rendering without RenderWindow
« on: February 26, 2014, 09:57:05 pm »
Hi,

I have some obscure problem with RenderWindow object (http://en.sfml-dev.org/forums/index.php?topic=14468.0). Is it possible to render SFML graphic objects and vertex arrays without using RenderWindow into usual HWND?

13
Graphics / Re: Error "WGL Message" on exit
« on: February 21, 2014, 06:06:27 pm »
This is a basic standard Windows application and with a single main window created with

Code: [Select]
hWnd = CreateWindow(
szWindowClass,
szTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
0,
1000 + (GetSystemMetrics(SM_CXFRAME) * 2), // Initial window width
1000 + (GetSystemMetrics(SM_CYFRAME) * 2) +
GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU), // Initial height
NULL,
NULL,
hInstance,
NULL);

The destruction of SFML RenderWindow is called before calling DestroyWindow(hWnd); for the main (and single) hWnd for which RenderWindow was created.
 

14
Graphics / Error "WGL Message" on exit
« on: February 21, 2014, 03:31:03 pm »
I have a simple test application which does nothing except of creating a new Render window from an existing HWND with the following statement:

Code: [Select]
m_pRendWnd = new sf::RenderWindow( hWnd );
On exit the render window is destroyed as follows:

Code: [Select]
if ( m_pRendWnd ) {
m_pRendWnd->setActive(false);
m_pRendWnd->close();
delete m_pRendWnd;
}

When I start this program and close it, the debugger shows the following message:


Quote
WGL Message:WGL: DDraw: UpdateClipList: GetClipList (1): DDERROR = DDERR_GENERIC

WGL Message:WGL: DDraw: UpdateClipList: GetClipList (2): DDERROR = DDERR_GENERIC

WGL Message:System Error: (1114):dettachMessageHook
Why this message is displayed?

Pages: [1]
anything