SFML community forums
General => General discussions => Topic started by: molmasepic on January 09, 2011, 06:22:21 pm
-
hello, i have been wondering if i was able to use directx with SFML
if so, then are there any tutorials about this?
also about directx...
im wondering about what linkers i should use in the compiler options
IDE: Code::Blocks
Compiler: MinGW
(if anyone has suggestions let me know)
PS: i have tried SFML with VC++ Express, and i have gotten many errors that im not sure on how to fix...
-
SFML uses OpenGL so it wouldn't know how to tell DirectX to draw stuff. Using DirectX also wouldn't be portable unless you have a library with both DirectX and OpenGL backends.
-
hmm..i see
then wouldnt that make my game not able to play on certain graphics cards?
my main thing about this game is compatability.
i plan to make it online(wish me luck xD), but im also using windows(i dont like VC++ because its not really portable)
basically im wondering if openGL is going to be graphic card picky... :?
-
OpenGL is the only cross-platform solution (at least, a proven, used worldwide), if you want portable, that's what you're looking for.
Every graphic card from these days seems to bring OpenGL drivers natively, and many AAA games have OpenGL rendering, and it's as good as directX.
If im not mistaken, Playstation 3 renders with openGL.
The only if is you must be careful with what features you use, p.e. a graphic card with opengl 1.1 won't be able to draw vbo's. But it can still draw vertex arrays.
Enjoy : )
-
then wouldnt that make my game not able to play on certain graphics cards?
No. Everyone has an OpenGL driver that supports the basic stuff that SFML uses. This will never be a problem.
i dont like VC++ because its not really portable
Sorry to go slightly off-topic, but this doesn't make sense. The code that you write may or not be portable, but not a compiler.
-
i dont like VC++ because its not really portable
Sorry to go slightly off-topic, but this doesn't make sense. The code that you write may or not be portable, but not a compiler.
VC++ supports some things other compilers don't (/Zw Microsoft Extensions) which he may not want to accidentally use. It's easy enough to just disable though those, I use VC++ on Windows and C:B on Linux and it works fine on both.
-
Every compiler has its own set of non-standard extensions, and many of them are enabled by default. VC++ is not special in this regard, use the right options if you want a strictly standard code ;)
Or better: use several compilers (at least gcc & VC++).
-
Or better: use several compilers (at least gcc & VC++).
i may go with this idea
Sorry to go slightly off-topic, but this doesn't make sense. The code that you write may or not be portable, but not a compiler.
and sorry, ive been sick so i may not make sense when i try to tell stuff
what i have heard is that not many people have tried installing VC++ express or any of those on a flash drive(i have an external HD if that helps in any way) also when compiling SFML with VC++ i have gotten some wierd errors:
Build Log
Rebuild started: Project: Carperon, Configuration: Debug|Win32
Command Lines
Creating temporary file "c:\Users\Francois\Desktop\Carperon\Carperon\Debug\RSP00000152244820.rsp" with contents
[
/Od /D "SFML-DYNAMIC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /c /ZI /TP .\main.cpp
]
Creating command line "cl.exe @c:\Users\Francois\Desktop\Carperon\Carperon\Debug\RSP00000152244820.rsp /nologo /errorReport:prompt"
Creating temporary file "c:\Users\Francois\Desktop\Carperon\Carperon\Debug\TMP00000252244820.tmp" with contents
[
1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ ".\\Debug\\Carperon.exe.embed.manifest"
]
Creating command line "rc.exe /fo".\Debug\Carperon.exe.embed.manifest.res" c:\Users\Francois\Desktop\Carperon\Carperon\Debug\TMP00000252244820.tmp"
Creating temporary file "c:\Users\Francois\Desktop\Carperon\Carperon\Debug\RSP00000352244820.rsp" with contents
[
/OUT:"C:\Users\Francois\Desktop\Carperon\Debug\Carperon.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\Carperon.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\Francois\Desktop\Carperon\Debug\Carperon.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 sfml-system.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\main.obj"
".\Debug\Carperon.exe.embed.manifest.res"
]
Creating command line "link.exe @c:\Users\Francois\Desktop\Carperon\Carperon\Debug\RSP00000352244820.rsp /NOLOGO /ERRORREPORT:PROMPT"
Output Window
Compiling...
main.cpp
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\Users\Francois\Desktop\Carperon\Debug\Carperon.exe : fatal error LNK1120: 1 unresolved externals
Results
Build log was saved at "file://c:\Users\Francois\Desktop\Carperon\Carperon\Debug\BuildLog.htm"
Carperon - 2 error(s), 0 warning(s)
^ theres the build log in VC++ if anyone wants to check it out^
also i think im going to try openGL anyways, just wondering about that okay i asked for earlier(compatability)
-
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function
You need to have WinMain as the entry point (replacing main), or link to sfml-main.
-
Hi again.
I have decided to use OpenGL with SFML(just because they can go together)
but im having a hard time finding the library itself
anyone know the correct site i can find it at?
-
You already have it, just link to GL (Linux) or opengl32 (Windows).
-
wow i feel slow... thanks xD
:D
EDIT: Hey i have been wondering if there are any good tutorials to use SFMl and OpenGL together. im looking right now, but if anyone has any good ones reply here
thanks :D
-
sorry bout doublepost...
wondering about where i could find a proper tutorial for this(one that includes adding textures/models/etc...
anyone got one let me know :D
-
There's an OpenGL example in the SFML SDK. And the OpenGL-specific things can be learned from OpenGL books/tutorials...
-
ok so i CAN use opengl tutorials.
and all the libraries i need for that are in the SDK?(just making sure xD)
and ill download that SDK again(lost it before lol)
thanks again
-
I know you don't wanna use DX anymore but since this is the topic I'm still gonna add my 'knowledge'. :D
I've programmed in the past a bit with DX and as far as I know, you won't be able to compile with MinGW for any DX app, since DirectX is based on the whole Microsoft stuff.
But with the VC++ Compiler you would probably still be able to use SFML, since DirectX only needs to know little about the window, which you would have to extract probalby by hand. ;-)
Then again when we look at what SFML provides and what DX can do, I think it doesn't make sense to use both in one application. So you got it right either use SFML + OpenGL and be cross-platform (if you programm right) or use DirectX and stay on Windows. :D
eXpl0it3r
-
I've programmed in the past a bit with DX and as far as I know, you won't be able to compile with MinGW for any DX app, since DirectX is based on the whole Microsoft stuff.
It's not true, MinGW works just fine with the official DirectX SDK.
-
I've programmed in the past a bit with DX and as far as I know, you won't be able to compile with MinGW for any DX app, since DirectX is based on the whole Microsoft stuff.
It's not true, MinGW works just fine with the official DirectX SDK.
Ah okay didn't know that! ;-)
-
To the OP, if you are still really keen on using Directx and windows. You can just create the Win32 code and read the input via RawInput. If you are targeting only a windows platform, DX is as good as in can get. With DX11 it can automatically scale to user hardware base on D3D_FEATURE_LEVEL. So no worries if user is only have DX9 hardware.
On the other hand. If you want to achieve cross platform, then you should use SFML and Opengl. Since opengl is supported on almost all platform, it would be easy to port code. i.e. you don't have to support 2 renderers. :)
However in my opinion, currently opengl is slightly lagging behind DX in terms of capabilities. e.g HLSL can now allow a certain degree of OO-ness in it which reduce the need of uber shaders, along with other stuff. It is not much a big deal since opengl would eventually catch up :)
Opengl and DX are basically just playing a game catch up with each other. To date I think DX is at an edge ever since dx10.1 and dx11 came out. Before that opengl was leading =) I am sure this cycle repeats itself. :D
regards