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

Author Topic: Texture ID Accessor  (Read 12225 times)

0 Members and 1 Guest are viewing this topic.

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Texture ID Accessor
« Reply #15 on: May 13, 2013, 05:27:08 pm »
I very much dislike glGet functions, they are really slow. Ugly, and high latency.

http://gamedev.stackexchange.com/questions/34944/glgetfloatv-should-it-be-avoided-can-it-be-replaced

And yes, the performance matters when designing a full 3D engine :). GL calls are a large speed impediment, and is the reason why debuggers like gDEBugger have counters for them.
« Last Edit: May 13, 2013, 05:30:15 pm by lolz123 »
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Texture ID Accessor
« Reply #16 on: May 13, 2013, 06:30:06 pm »
Yeah... but here you just have to do it once, the texture/shader ID never changes.
Laurent Gomila - SFML developer

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Texture ID Accessor
« Reply #17 on: May 13, 2013, 07:58:35 pm »
Quote
Yeah... but here you just have to do it once, the texture/shader ID never changes.

Having to cache it yourself when 4 more lines of code can be added to the SFML source to completely avoid this issue seems a bit silly to me. I know I could add it myself, but then nobody could use anything I write without compiling a custom version of SFML.

Why not just add the function for the next version of SFML? :P
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Texture ID Accessor
« Reply #18 on: May 13, 2013, 10:41:06 pm »
You misunderstood me. I'm not trying to argue for not adding this function. I'm just proving that what you say ("I cannot do that, I'm stuck, I have to use SDL") is overly exagerated because there's a 2 lines of code workaround.
Laurent Gomila - SFML developer

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Texture ID Accessor
« Reply #19 on: May 13, 2013, 11:13:34 pm »
Ah OK.

Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Texture ID Accessor
« Reply #20 on: May 14, 2013, 08:59:18 am »
I don't use SFML's shaders because I can't link multiple shaders to a program -- at least that's what I discovered last, and as far as I know, that part hasn't changed. SFML only allows to use one fragment and one vertex shader. I would have to change the sources in order to use combined shaders, whereas with raw OpenGL I can call glAttachShader whenever I want.

By the way, just like lolz123 I also use this for a custom 3D game library, and I wanted to use sf::Texture for convenience.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Texture ID Accessor
« Reply #21 on: May 14, 2013, 09:06:18 am »
Ok, I see.
Laurent Gomila - SFML developer

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
Re: Texture ID Accessor
« Reply #22 on: May 21, 2013, 03:52:06 pm »
I came across this problem, the 2 line workaround is okay but I guess a texture ID accessor would be nice to have.. Laurent I will swap you a carton of orange juice for your time to implement it? I can ship it to metz np.
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Texture ID Accessor
« Reply #23 on: May 21, 2013, 03:56:39 pm »
It will be added as soon as possible (not in SFML 2.1 which is a bug-fix release).
Laurent Gomila - SFML developer

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Texture ID Accessor
« Reply #24 on: January 04, 2015, 01:51:37 am »
Quote
It will be added as soon as possible (not in SFML 2.1 which is a bug-fix release).
Bump?
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Texture ID Accessor
« Reply #25 on: January 04, 2015, 02:04:18 am »
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).