
559 S.W.2d 901 (1977)
In the Interest of V.----- M.----- B.-----, III, a minor child.
No. 8757.
Court of Civil Appeals of Texas, Amarillo.
December 9, 1977.
Rehearing Denied January 3, 1978.
Jones, Trout, Flygare & Moody, Chauncey Trout, Lubbock, for appellant.
Key, Carr, Evans & Fouts, Donald M. Hunt, Lubbock, for appellee.
Leota Heil Alexander, Lubbock, as guardian ad litem for minor child.
ROBINSON, Chief Justice.
Our November 30, 1977, opinion is withdrawn sua sponte and, in lieu thereof, this opinion is substituted.
*902 This is an appeal from a summary judgment denying an unwed father legitimation and custody of his son. The father has never seen the son who was born in 1971. Defendants are the child's mother, the maternity home to which the mother had executed affidavits of relinquishment and consent for adoption, and the prospective adoptive parents. The minor child is not a party to the suit and was not served with citation. The trial court appointed a guardian ad litem for the minor. The prospective adoptive parents were not served, but they answered and filed a petition for adoption of the child. The maternity home filed a cross claim asking that the paternal rights of the petitioner father and the mother be terminated and the home made managing conservator. The mother did not answer. The trial court severed the petition for adoption and the maternity home's cross action for termination and managing conservatorship from the suit for legitimation and custody. It held that the question of legitimation had been determined adversely to the father by a court of competent jurisdiction of a foreign state and that the decision was res judicata of the issues presented in this suit for legitimation and custody and entered summary judgment against the father. Affirmed.
The relevant facts are established as a matter of law by summary judgment evidence.
In the fall of 1970. Petitioner father, a resident of New York, lived with the defendant mother, a resident of Oklahoma, for about 2 months while they were both college students in Oklahoma. She became pregnant. Shortly afterwards, the relationship between the father and the mother terminated.
March 17, 1971. Petitioner sued the mother in Oklahoma alleging a common law marriage and seeking a divorce and custody of the unborn child. After a hearing the Oklahoma district court held that the evidence was insufficient to establish a common law marriage.
July 30, 1971. The father graduated from college and returned to his home in New York City.
August 11, 1971. The mother gave birth to a male child at a maternity home in Texas. It is stipulated that petitioner father is the biological father of this child.
August 12, 1971 and August 27, 1974. The mother executed affidavits of relinquishment of parental rights and consent for adoption to the maternity home. A few months after the birth of the child the home placed him with prospective adoptive parents and he has remained with them since that time.
November 17, 1971. The father filed suit against the mother in an Oklahoma district court asking for a declaratory judgment legitimating the child and seeking orders giving him custody. There was a hearing with testimony in this cause.
November 24, 1971. The father filed suit in Texas seeking a temporary injunction to prevent the home from allowing adoption of the child. All parties agreed that no adoption proceedings would be instituted until after the outcome of the Oklahoma litigation.
April 3, 1972. The United States Supreme Court decided Stanley v. Illinois, 405 U.S. 645, 92 S.Ct. 1208, 31 L.Ed.2d 551 (1972). Stanley was an unmarried father who had raised his children while living with the children's mother. On the mother's death, Stanley's children were declared wards of the State in a dependency proceeding instituted by the State of Illinois and were placed with court-appointed guardians. The Supreme Court held:
We conclude that, as a matter of due process of law, Stanley was entitled to a hearing on his fitness as a parent before his children were taken from him and that, by denying him a hearing and extending it to all other parents whose custody of their children is challenged, the State denied Stanley the equal protection of the laws guaranteed by the Fourteenth Amendment.
September 6, 1972. The "Journal Entry of Judgment" of the Oklahoma district court, denying relief to the father in his *903 November 17, 1971, suit for legitimation and custody, was filed. The judgment recites that a hearing, at which testimony was taken, was held on April 5, 1972, and that findings of fact and conclusions of law were made on May 1, 1972.
The court found, among other things, that the child had never been in Oklahoma; that the law of the State of New York, which it found to be the father's domicile, should govern the question of legitimation; that the best interest of the child would not be served by legitimation; and that the court had no jurisdiction to enter any orders in the cause. The father appealed to the Court of Appeals of Oklahoma.
August 14, 1973. The Court of Appeals of the State of Oklahoma, District No. 1, affirmed the judgment of the Oklahoma district court.
The Oklahoma appellate court held that the question of legitimation should be determined under the law of New York, that the marriage of the parents of the illegitimate child was necessary for legitimation under New York law; that the acts of the father were insufficient to bring him within the requirements of the New York law.
January 1, 1974. The Texas Family Code went into effect.
Section 11.01(3) of the code provides:
"Parent" means the mother, a man as to whom the child is legitimate, or an adoptive mother or father, but does not include a parent as to whom the parent-child relationship has been terminated.
Section 13.01 provides, as follows, for voluntary legitimation upon the filing of a statement of paternity executed by the unwed father:
(b) If a statement of paternity is filed with the State Department of Public Welfare, the father, the mother, or the department may institute a suit for a decree establishing the child as the legitimate child of the person executing the statement. On the consent of the mother, the managing conservator, or the court, and on the filing of the statement of paternity with the petition, the court shall enter a decree declaring the child to be the legitimate child of the person executing the statement of paternity.
In its opinion in In the Interest of K, 535 S.W.2d 168 (Tex.1976) (U.S.Cert. den.) the Texas Supreme Court construed the foregoing provision relating to consent to legitimation by the court as follows:
If the court must consent to the matter, discretion is thereby conferred upon the judge to see that the one who would assume parental rights and responsibilities is fit to do so and that a decree declaring this relationship is made only if it is in the best interest of the child.
April 29, 1974. The father filed the cause before us in Texas district court again seeking legitimation and custody.
August 15, 1974. The Texas court appointed a guardian ad litem to represent the interest of the child in this cause.
April 30, 1975. A year after the suit was filed, the father mailed an affidavit of paternity to the Department of Public Welfare. The father and the home have stipulated "that the statement may be considered as having been filed prior to the institution of the suit."
September 1, 1975. The Family Code was amended to provide for voluntary legitimation in the following language:
Section 13.21. Voluntary Legitimation
(a) If a statement of paternity has been executed by the father of an illegitimate child, the father or mother of the child or the State Department of Public Welfare may file a petition for a decree designating the father as a parent of the child. The statement of paternity must be attached to the petition.
(b) The court shall enter a decree designating the child as the legitimate child of its father and the father as a parent of the child if the court finds that:
(1) the parent-child relationship between the child and its original mother has not been terminated by a decree of a court;
(2) the statement of paternity was executed as provided in this chapter, and the facts stated therein are true; and

*904 (3) the mother or the managing conservator, if any, has consented to the decree.
(c) The requirement of consent of the mother is satisfied if she is the petitioner. If the entry of the decree is in the best interest of the child, the court may consent to the legitimation of the child in lieu of the consent of the mother or managing conservator.
(d) A suit for voluntary legitimation may be joined with a suit for termination under Chapter 15 of this code.
(e) A suit under this section may be instituted at any time.
In the case before us the trial court granted the maternity home's motion for summary judgment. The court denied the father legitimation and custody and held that the Oklahoma district court decree was res judicata on the question of legitimation. The father has appealed from that summary judgment.
In Hammonds et ux. v. Holmes et al., 559 S.W.2d 345, Tex.1977, the Court stated:
(A) question of fact or of law distinctly put in issue and directly determined by a court of competent jurisdiction as a ground of recovery or defense in a suit or action between parties sui juris, is conclusively settled by the final judgment or decree therein, so that it cannot be further litigated in a subsequent suit between the same parties or their privies, whether the second suit be for the same or a different cause of action. State of Oklahoma v. State of Texas, 256 U.S. 70, 86, 41 S.Ct. 420, 65 L.Ed. 831 (1920).
The doctrine of res judicata extends to the questions of law and issues of fact and binds not only the parties to the first suit but also those in privity who claim under a party. Swilly v. McCain, 374 S.W.2d 871 (Tex.1964); Kirby Lumber Corp. v. Southern Lumber Co., 145 Tex. 151, 196 S.W.2d 387 (Tex.1946); Marange v. Marshall, 402 S.W.2d 236 (Tex.Civ.App.-Corpus Christi 1966, writ ref'd n. r. e.). Moreover, the former judgment is decisive of all questions raised and all questions that should have been raised. White v. Burch, 33 S.W.2d 512 (Tex.Civ.App.-Fort Worth 1930, writ ref'd).
It is undisputed that plaintiff had a hearing in the Oklahoma legitimation suit at which hearing he and two other witnesses testified. The subject matter was the same as that before us and the parties were the same or in privity with those before us.
The father, however, urges that he is entitled to a hearing on his parental fitness under the holding of Stanley v. Illinois, supra.
It is significant that Stanley was decided two days before the hearing in Oklahoma district court and more than 6 months before the judgment denying the father a declaratory judgment of legitimation was entered. The appeal of that cause was not decided for well over a year after Stanley was decided. Thus, the father had an opportunity to assert in the Oklahoma court any rights that Stanley may have given him.
The rule of res judicata bars litigation of issues connected with a cause of action or defense which with the use of reasonable diligence might have been tried in a former trial as well as those which were actually tried. Chem-Gas Engineers Inc. v. Texas Asphalt & Refining Co., 398 S.W.2d 143 (Tex.Civ.App.-Waco 1965, no writ).
Further, it is settled that the principles of res judicata apply whether the first court determined the question before it correctly or erroneously. White v. Swift & Co., 187 S.W.2d 127 (Tex.Civ.App.-Austin 1945, writ ref'd); Zavala-Dimmitt Counties Water Imprv. Dist. No. 1 v. McMillian, 127 S.W.2d 364 (Tex.Civ.App.-San Antonio 1939, writ ref'd); Wetherell v. Santex Gas & Oil Co., 93 S.W.2d 543 (Tex.Civ.App.-El Paso 1936, writ ref'd).
Petitioner-father also contends that the Oklahoma decree cannot be res judicata because of the court's conclusion that it did not have jurisdiction to enter any order in the cause. In that connection we find that the father had asked for two things in his petition(1) a declaration of legitimation *905 and (2) specific orders on custody. Reading the decision as a whole it is apparent that the trial court ruled on the merits of the legitimation question, but declined to enter an order on custody after finding that the child had never been in the State of Oklahoma. Likewise, the opinion of the Oklahoma appellate court reaches the merits of the question of legitimation.
Judgments of courts of record should be so construed and empowered as to give them every quality of finality of which they are susceptible, and their dignity and integrity should be given such effect as to bar further litigation upon the matters brought into controversy in the suit in which the decree is entered, or in which any matter material to the suit could properly have been litigated. Stephenson v. Gaines, 291 S.W. 602 (Tex.Civ.App.-San Antonio 1926, no writ).
We conclude that the Oklahoma district court judgment adverse to the father is res judicata of the father's petition for legitimation before us.
In the absence of legitimation, the father cannot assert parental rights. The summary judgment evidence establishes as a matter of law that the father, albeit through no fault of his own, had no relationship with his child which would permit one, not a parent, to claim custody against the maternity home to whom the sole parent executed affidavits of relinquishment of parental rights and consent for adoption.
The judgment of the trial court is accordingly affirmed.
DODSON, J., not sitting.
