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

Author Topic: RenderWindow is missing a constructor  (Read 28510 times)

0 Members and 1 Guest are viewing this topic.

Odeamus

  • Newbie
  • *
  • Posts: 8
    • View Profile
RenderWindow is missing a constructor
« on: January 02, 2009, 02:20:47 pm »
The RenderWindow class is missing its default constructor. It's not a biggie, but it's one more thing that's different than the c++ interface.

O.

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
RenderWindow is missing a constructor
« Reply #1 on: January 02, 2009, 09:06:23 pm »
Hi,

I know, but IMO, it doesn't make sense to create an empty window. Moreover, i don't have any empty constructor through the C api.

I'll add that to the differences, but i don't see any reason (in the D context) to provide a default ctor for a window.

Thanks for your report. =)

Odeamus

  • Newbie
  • *
  • Posts: 8
    • View Profile
RenderWindow is missing a constructor
« Reply #2 on: January 02, 2009, 10:12:06 pm »
You have a point, but I don't see what D has anything to do with this. At the moment there is no way to create an instance of renderwindow without showing it on the screen too. It would be nice to be able to do that. Makes the code look neater, especially when changing the window while the application is running.

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
RenderWindow is missing a constructor
« Reply #3 on: January 02, 2009, 10:40:30 pm »
Hum, i see your point.

In fact, there is an other reason for this. All class have an invariant control and null pointers cannot even exists with this contract (for the same reason, SoundStream doesn't have an initialize method, but sample rate and channels count are passed from the protected ctor).

But I think, i'm gonna drop all the invariants contracts which, imo aren't that useful. =)

Odeamus

  • Newbie
  • *
  • Posts: 8
    • View Profile
RenderWindow is missing a constructor
« Reply #4 on: January 02, 2009, 11:01:03 pm »
Great. :)

I've always got a bad feeling when call a function like createWindow and it's already showing it afterwards. Maybe I've been spoiled by swing, dunno. :) I just think the creating the window and showing it are two different things.

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
RenderWindow is missing a constructor
« Reply #5 on: January 03, 2009, 07:57:04 am »
Yeah, me too. But we don't talk of a rich app framework here, windowing capabability are minimal, when you create a window, you don't want some dummy callback window or other non visible things. That's why at first sight, I didn't see the point of empty ctor (and for the previous reason too).

But i'm agree with you, if I drop invariants stuffs, there is no reason to not provide an empty ctor. =)