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

Author Topic: Using Directx with SFML  (Read 18926 times)

0 Members and 2 Guests are viewing this topic.

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Using Directx with SFML
« 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...

Terrydil

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Using Directx with SFML
« Reply #1 on: January 09, 2011, 06:38:08 pm »
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.

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Using Directx with SFML
« Reply #2 on: January 09, 2011, 10:21:58 pm »
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...  :?

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Using Directx with SFML
« Reply #3 on: January 09, 2011, 10:27:08 pm »
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 : )

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using Directx with SFML
« Reply #4 on: January 09, 2011, 10:47:27 pm »
Quote
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.

Quote
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.
Laurent Gomila - SFML developer

JAssange

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Using Directx with SFML
« Reply #5 on: January 09, 2011, 10:59:40 pm »
Quote from: "Laurent"

Quote
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using Directx with SFML
« Reply #6 on: January 09, 2011, 11:02:40 pm »
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++).
Laurent Gomila - SFML developer

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Using Directx with SFML
« Reply #7 on: January 10, 2011, 01:21:06 am »
Quote from: "Laurent"


Or better: use several compilers (at least gcc & VC++).


i may go with this idea

Quote from: "Laurent"
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:

Code: [Select]
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)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using Directx with SFML
« Reply #8 on: January 10, 2011, 08:26:34 am »
Quote
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.
Laurent Gomila - SFML developer

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Using Directx with SFML
« Reply #9 on: January 10, 2011, 07:03:21 pm »
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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using Directx with SFML
« Reply #10 on: January 10, 2011, 07:07:21 pm »
You already have it, just link to GL (Linux) or opengl32 (Windows).
Laurent Gomila - SFML developer

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Using Directx with SFML
« Reply #11 on: January 10, 2011, 07:16:33 pm »
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

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Using Directx with SFML
« Reply #12 on: January 12, 2011, 10:56:12 pm »
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

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Using Directx with SFML
« Reply #13 on: January 12, 2011, 11:43:54 pm »
There's an OpenGL example in the SFML SDK. And the OpenGL-specific things can be learned from OpenGL books/tutorials...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Using Directx with SFML
« Reply #14 on: January 13, 2011, 01:06:23 am »
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

 

anything